# How do I Shoot multiple projectiles at once (Not so simple)

Get help using Construct 2

### » Mon Mar 13, 2017 11:34 pm

Hi there

I have bullets in the level, and I collect then, I store the amount of bullets that I have in a variable "bullets".

Then I want to shoot then all (all the bullets that I have) at once, in different directions.
But not random directions, creating a sort of shield around the player from 180 to 360 degrees (like a rainbow of bullets going upwards and sideways).

I tried to make a loop for it, shooting a bullet and looping it to the amount of bullets i have. It didn't work as you may see ... I find nothing about it and have no ideas to do so.

Any help would be reeeeeaaally appreciated!
Thanks
B
28
S
14
G
6
Posts: 90
Reputation: 5,492

### » Tue Mar 14, 2017 12:04 am

B
126
S
54
G
24
Posts: 795
Reputation: 24,123

### » Tue Mar 14, 2017 12:11 am

Hmmm?

Interesting effect.

I think I would create a half circle sprite and put your image points wehere you want the bullets to spawn from on the arc.

Pin the arc to the player when needed and make it invisible and use those image points to spawn your bullets using a compass setting angle. 0 is right, 270 is up, 180 is left so use 315 and 225 for the diagonals.
Banned User
B
29
S
7
G
58
Posts: 1,229
Reputation: 34,910

### » Tue Mar 14, 2017 5:00 pm

Here's with a loop. Don't crank up the number of bullets too high otherwise it'll lag to a crawl.

https://dl.dropboxusercontent.com/u/700 ... otArc.capx
B
80
S
33
G
27
Posts: 1,027
Reputation: 21,114

### » Thu Mar 16, 2017 4:33 pm

Dropbox dropped the support of the "Public folder" so the previous link won't work anymore.

Here's another link, with a better formula for bullet angle calculation.

https://www.dropbox.com/s/y2fcnyferef3e ... .capx?dl=0
B
80
S
33
G
27
Posts: 1,027
Reputation: 21,114

### » Mon Mar 20, 2017 3:30 am

Thank you guys, you are awesome!
@Magistross you saved me in this one Thanks again!
B
28
S
14
G
6
Posts: 90
Reputation: 5,492