Set Bullet Range at Runtime

New releases and general discussions.

Post » Wed Oct 29, 2008 3:32 am

I think it would be nice to have the option to set the range of the bullet behavior at runtime. It would be a big help for certain type of bullets but still use the same object. For example, you could have machine gun bullets set to have a short range, but if you want a sniper rifle to have a longer range, you could increase the max distance so it can travel farther. This would make it to where you wouldn't have to create a sniper bullet and a standard bullet and check the collisions for each type. It would be a lot easier. :)
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Wed Oct 29, 2008 1:21 pm

you could just set a private variable "range" and look for the distance constantly between it and the player and if it is out of range then it dosent do any damage. Then you could set another private variable in the player "Weapon" and change the range of the single bullet.
if you wanted to change how it looked then make the bullets frames of an animation and events that check which weapon is equipped so that it switches to the right bullet type. just pause the animation on start of frame.
B
5
S
2
G
4
Posts: 632
Reputation: 2,829

Post » Wed Oct 29, 2008 1:23 pm

Added for next build!
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Wed Oct 29, 2008 3:00 pm

[quote="Ashley":f9v62ypd]Added for next build![/quote:f9v62ypd]

Awesome! Thanks. :)
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests