Set Position of Bullet Stops Movement

Bugs will be moved here once resolved.

Post » Wed Dec 19, 2012 6:15 pm

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.
Posts: 4
Reputation: 1,040

Post » Wed Dec 19, 2012 6:38 pm

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.Kyatric2012-12-19 18:39:53
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Posts: 7,425
Reputation: 75,374

Post » Thu Dec 20, 2012 12:26 pm

Closing as not a bug, project is working correctly for the given events.
Scirra Founder
Posts: 25,281
Reputation: 200,831

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 4 guests