Confetti Cannon

G

Garrzilla

Guest
I'm wondering how to go about making a confetti cannon effect. So far I've got an object that creates a single confetti every step at the top of the screen, then gravity makes it fall:

https://i.gyazo.com/7448324df861d40c5fcb1c9aeaa1637a.mp4

How would I go about making a cannon effect, where it shoots like 100 confetti in one step, from the bottom right of the screen upward.
 

TsukaYuriko

☄️
Forum Staff
Moderator
Apply movement to it according to how you want it to move (just up, up and to the left...), let gravity affect it and repeat this 100 times using a loop (repeat, for example).

I'm not sure where your problem with this lies, as you've only described what you're trying to do - could you please elaborate on that part?
 

JasonTomLee

Member
You could create the effect by creating the "Confetti Object" multiple times in an Alarm event. This way you can control when it triggers & the code is only run once~
But make sure to add variation by randomizing the direction and speed of the Confetti so they don't look too similar!
Example:

Code:
if ( *trigger the confetti condition* ){
alarm[0] = 1;
}

/// Alarm[0] Event
repeat( 100 ){
instance_create( 0,room_height, obj_confetti );
}
 

Kyon

Member
I would maybe work with particles. I have this confetti gun in my game and I let the particle start with a high speed and it slows down a lot, but still has gravity. Makes a really realistic look.
Code:
part_type_gravity(confettipt, 0.18, 270);
    part_type_direction(confettipt, 0, 360, 0, 30);
    part_type_speed(confettipt, 2, 4, -0.25, 0);
 
G

Garrzilla

Guest
I would maybe work with particles. I have this confetti gun in my game and I let the particle start with a high speed and it slows down a lot, but still has gravity. Makes a really realistic look.
Code:
part_type_gravity(confettipt, 0.18, 270);
    part_type_direction(confettipt, 0, 360, 0, 30);
    part_type_speed(confettipt, 2, 4, -0.25, 0);
Thank you for this, didn't even think about particles. I did some research into it and came up with this. Thanks!
 
Top