Bullet Distance

Just started using Construct 2? Post your questions here

Post » Thu Nov 27, 2014 1:22 am

How would I set the distance I want my bullets to travel? I thought it would be move forward but that obviously spawns them at that location. I don't want them going on indefinitely...
B
4
Posts: 14
Reputation: 236

Post » Thu Nov 27, 2014 2:21 am

Dead simple if you are using the bullet behavior. Just set a global var (BulletLife) with the maximum distance you want the bullet to travel. Then:

Foobar.Bullet.DistanceTraveled > BulletLife
--Destroy Bullet

Here's a capx:

https://www.dropbox.com/s/6rllxv4a0a7uj ... .capx?dl=0
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,187

Post » Thu Nov 27, 2014 4:04 am

Thank you!
B
4
Posts: 14
Reputation: 236


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest