So I'm making a game (obviously), that doesn't have any violence in it. I thought I would use a confetti gun to distract the enemy instead of killing them, but I'm not too sure how to start. I tried using a bullet, but that didn't act the way I wanted (fired like a normal bullet). Any suggestions would be appreciated. Here's what I'm hoping it to turn out similar to: gamepedia.cursecdn.com/terraria_gamepedia/3/3d/Confetti_Gun_%28demo%29.gif
From Terraria if you are interested where it's from.
If the projectiles must behave as bullets, I would suggest you use the bullet behavior and several projectiles at once. If they're just eye candy, a particle object would do...
Here's an example using bullet behavior.
Develop games in your browser. Powerful, performant & highly capable.
You can spawn sprites with Particles object, this allows to randomize each particle shape, color, rotation etc. You can also detect when individual particles collides with an enemy. See this demo:
dropbox.com/s/n0ljyz6gt6grygb/Confetti.c3p
But if you want them to bounce off walls, you'll need to use Bullet as Brunopalermo suggested, or Physics.
I didn't know we could detect particle collision... Nice to know! Thanks dop2000!!
Yes, if you select another object in "Object" field, it will spawns instances of this object as particles. Pretty cool feature.
Thanks for the help! I tried doing it with the particles and it works great. I also added the bullet behavior, making it act solid against the ground. One problem is that when it hits the floor, it turns 180 degrees rapidly, making it look like it's glitching into the floor.
drive.google.com/drive/folders/1VR3Dr3DYHVe3kRQRv03d-ucnh4Sm-pFY
That's a basic mock-up for what's happening, without all the other stuff in my game.
Use either Bullet or Particles, not both.
If you want the confetti sprites to bounce off the floor, create them with events, randomize their angle, speed, gravity, rotation etc.
Yeah, that worked, thanks for the help. :D