How do I create steps?

0 favourites
  • 7 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Absolutely love the program by the way, am so glad I found it.

    I am having trouble phrasing my issue, so I will just say what I want to happen...

    -----------------------

    (keyboard) space pressed

    + (sprite position) X=74    -then-    (set sprite position) X=88 Y=274

    (keyboard) space pressed

    + (sprite position) X=88    -then-    (set sprite position) X=69 Y=127

    (keyboard) space pressed

    + (sprite position) X=69    -then-    (set sprite position) X=476 Y=195

    ------------------------

    So I want to press the space bar and have the sprite reposition, then hit space bar again and have the sprite reposition again. Right now If I hit space bar it skips the middle step and jumps to the final position (if I disable the final event, it repositions correctly to the 2nd event).

    I am not sure what more I need to do. Thank you!

  • - Try adding an 'Else' condition to your last two events:

    -----------------------

    (keyboard) space pressed

    + (sprite position) X=74    -then-    (set sprite position) X=88 Y=274

    Else

    (keyboard) space pressed

    + (sprite position) X=88    -then-    (set sprite position) X=69 Y=127

    Else

    (keyboard) space pressed

    + (sprite position) X=69    -then-    (set sprite position) X=476 Y=195

    ------------------------

  • Hi rN, unfortunately I cannot add 'Else' there, it claims it is invalid.

    I tried adding a 'Wait 1 second' to the actions of each event but that didn't seem to work either.

  • Else is only valid if it's the first condition AND also only if the previous event is not a trigger.

    You could also just reverse the order of your events.

  • Try reversing the order of your events.

    Edit... I'm too slow.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh sweet that totally worked!

    I would be very grateful if someone could explain why that worked, in case I encounter this again...

  • Actions are processed before the evaluation of the next event's condition occurs. So basically, your sprite is climbing all steps at once, because all events were executed since all conditions were true at the time they were evaluated.

    Usage of "else" statements would have prevented this, but key press are "trigger event". You could have used a combination of "key is down" and "trigger once" though...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)