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

Get help using Construct 2

Post » Mon Mar 13, 2017 11:34 pm

Hi there :D

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 8-) ... I find nothing about it and have no ideas to do so.

Any help would be reeeeeaaally appreciated!
Thanks
We have what we are looking for.
B
25
S
12
G
4
Posts: 57
Reputation: 4,123

Post » Tue Mar 14, 2017 12:04 am

ImageImage
B
105
S
46
G
23
Posts: 778
Reputation: 22,226

Post » 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
27
S
7
G
58
Posts: 1,229
Reputation: 34,780

Post » 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. :P

https://dl.dropboxusercontent.com/u/700 ... otArc.capx
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » 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
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Mon Mar 20, 2017 3:30 am

Thank you guys, you are awesome!
@Magistross you saved me in this one ;) Thanks again!
We have what we are looking for.
B
25
S
12
G
4
Posts: 57
Reputation: 4,123


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests