How do I make a bullet spread gun?

Get help using Construct 2

Post » Mon Mar 10, 2014 9:58 pm

I'm playing around with the top down shooter from one of the tutorials here and I'm trying to make a "bullet spread" item. Preferably I wanted to make it at random angles within a certain angle space oriented by the player's own angle. It'd be something like a "triangle" in which bullets are shot at random angles within it. My question is: is it possible to do so? And if so, how?
B
3
Posts: 5
Reputation: 185

Post » Mon Mar 10, 2014 10:05 pm

Yes it is possible. You have to set the bullets angle on creation to random(player.angle-45, player.angle+45). This whould spread the bullets in a 90° range infront of the player.
Last edited by Alyra Games on Mon Mar 10, 2014 10:06 pm, edited 1 time in total.
B
10
S
2
Posts: 135
Reputation: 1,090

Post » Mon Mar 10, 2014 10:06 pm

I'm going to try that out, really thanks for the reply!
EDIT:
That worked like a charm, thanks a lot! :D
B
3
Posts: 5
Reputation: 185

Post » Mon Mar 10, 2014 10:09 pm

Glad I could help. You can change the 45 values to anything you want to increase the spread. If you change them to 90° the player should spreed the bullets at a 180° angle. :)
B
10
S
2
Posts: 135
Reputation: 1,090

Post » Mon Mar 10, 2014 10:50 pm

I'm having some fun with it by doing a flamethrower, I've set them to 15º both and made the fade in and out times quicker and the speed higher. It's so fun to kill everything with fire haha
B
3
Posts: 5
Reputation: 185


Return to How do I....?

Who is online

Users browsing this forum: dop2000, kriand, matriax, NN81 and 7 guests