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: 3
Reputation: 888

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: 6,938
Reputation: 56,920

Post » Thu Dec 20, 2012 12:26 pm

Closing as not a bug, project is working correctly for the given events.
Scirra Founder
Posts: 22,832
Reputation: 176,710

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 0 guests