0 Favourites

condition tests and kb presses

  • 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.

  • Ha, figured out the dropbox thing (I think).

    dl.dropbox.com/u/16870630/diggertest.capx

  • 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.

    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.

    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.

    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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Very cool !    

    Thank you for your help & quick response!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
Your C2 tests
566 243,738
thisisblogs's avatar
thisisblogs
Unread hot topic
119 7,539
Silverforce's avatar
Silverforce
Unread hot topic
86 23,846
bscarl88's avatar
bscarl88