condition tests and kb presses

Discussion and feedback on Construct 2

Post » Thu Jul 28, 2011 4:44 pm

Hello,
I'm playing around with this and building a quickie game to test things out. I want my player to start with 10 bullets (set global variable called bullets to 10). Now what I wanted to do was only check the keyboard press if bullets > 0. Or, check for keyboard press but then check if bullets > 0 and then execute destroy bullet sprite. either way, I am not seeing how to accomplish this with construct 2. also, how do I get back to the default layout the way it was when I installed construct 2? I managed to "un-pin" my objects/layout/layers window. Sorry, I don't see where to attach the capx file. Thank you for your help.
B
2
G
2
Posts: 5
Reputation: 1,058

Post » Thu Jul 28, 2011 4:48 pm

Ha, figured out the dropbox thing (I think).
http://dl.dropbox.com/u/16870630/diggertest.capx
B
2
G
2
Posts: 5
Reputation: 1,058

Post » Thu Jul 28, 2011 6:20 pm

[QUOTE=profrisley] Hello,
I'm playing around with this and building a quickie game to test things out. I want my player to start with 10 bullets (set global variable called bullets to 10). Now what I wanted to do was only check the keyboard press if bullets > 0. Or, check for keyboard press but then check if bullets > 0 and then execute destroy bullet sprite. either way, I am not seeing how to accomplish this with construct 2.
[/quote]

You can have two conditions in a single Event block.
That means that if you add an event keyboard "On 'T' key pressed" ( 'T' for example).
Right click on that event and "Add another condition".
Then add a system "Compare two values" Bullets > 0.

There you go. The event will trigger when T is pressed AND bullets > 0.

[QUOTE=profrisley]
also, how do I get back to the default layout the way it was when I installed construct 2? I managed to "un-pin" my objects/layout/layers window. Sorry, I don't see where to attach the capx file. Thank you for your help.
[/QUOTE]

I guess you can go in the top ribbon ("tabs" Home, View and Events). Click on the view one, and then on the left on "bars".
If that doesn't help, then I will need you to be more specific about your current layout to see what needs to be changed/done.
As far as I know, there's no "Reset global layout" option.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Thu Jul 28, 2011 10:06 pm

Very cool !    

Thank you for your help & quick response!!
B
2
G
2
Posts: 5
Reputation: 1,058


Return to Construct 2 General

Who is online

Users browsing this forum: shinichild and 7 guests