Set Position of Bullet Stops Movement

0 favourites
  • 3 posts
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!
  • Setup: I have a sprite with Bullet behavior. The speed of the bullet is set to 100. The bullet is initially positioned somewhere inside the visible layout.

    Add a global variable named "Phase". Set it's initial value to "before".

    1. The first event, on layout start, waits for 3s. Then sets "Phase" to "start".

    2. The second event, compares the value of "Phase" and when equal to "start" sets the position of the bullet to 0,0.

    OBSERVE: The bullet stops moving, instead of continuing from it's previous position. Note: setting the bullet to enabled or changing its speed has no effect. It's stuck.

    dropbox.com/s/e3h40oko4mbb485/FollowPath.capx

  • The event sheet is read from top to bottom every tick (frame) of execution.

    And the actions of an event are executed when their condition is true.

    So 1 second after the start of execution a variable is set to a certain value, and every tick C2 testes if this variable is equal to this value.

    As it is, it positions the bullet to 0,0, stopping the movement when actually the sprite is moved and repositioned every tick.

    Add a condition "System: Trigger once while true" to your event 2 and it works as you intended it.

    Nevertheless I'd strongly suggest you to go through some tutorials like my asteroid clone in less than 100 events which should introduce you to a lot of elements of C2 like that.

    This issue is not a C2 bug though.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Closing as not a bug, project is working correctly for the given events.

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