Spawn multiple bullets with variance starting poin

Get help using Construct 2

Post » Sun Feb 17, 2013 8:42 pm

I want to spawn multiple bullets for every mouse click, I was able to achieve that with system repeat condition but in the layout when running it appears as the same bullet as they starting from the same image point and same acceleration. What is the best way to provide the visual differentiation of these multiple bullets.

I was able to think of the following

1) use a system wait in the action so bullets gets created after that delay (I tried it but for some reason I am still not able to see it)

2) set a random speed (this shows the difference only if the range of random values is big)

is there any other way, I think the best way is to add a variance to the image points for each of this creation is that possible or is there a better way to achieve this.

Posts: 1
Reputation: 252

Post » Sun Feb 17, 2013 9:30 pm

You can't vary the image points themselves, but you could create multiple image points and have the bullet spawn from a random one.

Alternatively, use the system>create object function to spawn the bullets at "spawner.ImagePointX(0)+random(-10,10)), spawner.ImagePointY(0)+random(-10,10)" (or however much of a random spread you want).

Altering speed, as you said, is also a good way, but that depends entirely on your gameplay dynamics, and generally bullets move at the same speed when fired from the same gun, anyway.
Posts: 912
Reputation: 12,626

Post » Mon Feb 18, 2013 2:59 am

You can slightly alter their angle (aka spray) by setting each one's angle to Sprite.angle(random(Sprite.angle-1,Sprite.angle+1))
Posts: 210
Reputation: 6,038

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, max2612, mchulet, Seruza and 8 guests