Stop Bullet Movement

Get help using Construct 2

Post » Wed Jun 20, 2012 9:49 am

From what I can understand, for the bullet movement, setting speed to 0 or disabling the bullet movement should stop the bullet from moving. I don't know if using a text box or a sprite makes a difference, but I'm using a text box.

This is what I have so far

when        X = 1 -> set text box bullet speed to 40
                   -> set bullet angle of motion to 0 degrees

      when textbox X=300 -> set bullet disabled
                         -> set speed=0

I've tried it with the x=300 text both as a subevent, and on the same level

when I run it, the textbox moves ok, but it doesn't stop at all.

B
12
S
3
G
4
Posts: 55
Reputation: 3,186

Post » Wed Jun 20, 2012 10:08 am

Your text box could be moving to many pixels per sec to ever hit X=300. Try using system: compare two values and check the distance from where you want to stop. Choose the smallest number that works, try 5 or something first.

[code]+System: distance(TextBox.X, 0, 300, 0) < 5)
->Set bullet speed to 0
->Set Y to (300)[/code]Nimtrix2012-06-20 10:23:38
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Wed Jun 20, 2012 10:50 am

I figured out the problem - I had the distance check in the wrong place Thanks for the help
B
12
S
3
G
4
Posts: 55
Reputation: 3,186


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests