GMS2 Tutorial - Easy Particle Effects - No Art Required Copy Paste Code - GameMaker Studio 2
Hello everyone, in this GameMaker Studio 2 Tutorial video we learn how to make cool looking particle effects with very little effort. This video will walk you through all the steps required to make it work. First we create a couple new layers, a BottomParticleLayer and a TopParticleLayer, that way we can have particles play at different depths and show things below and above sprites. Then we create a new object that has two events, a create event and a Game End event. The create event will be where we type the code that creates a new particle system and a new particle type. The Game End event is where we destroy the particle system and particle type to prevent any potential memory leaks that come along with making particle systems. Then we create a simple script that we'll be using to call the particle effect. This method will give us much more flexibility on how and when we play the particle effects. Finally we take a look at a couple different ways we can call the script to play particles, first using the mouse clicks and mouse locations, and then to make it play when the player moves. You can basically play the particles at any point in time, just place the script call where you want it to show.
! Don't forget to drag and drop the new object we created onto the room you want to play the particle on, or it'll crash because it won't find the particle system you're referencing!
Here's the copy paste code:
Object: obj_DGparticleSystem1
Create event:
DGpartSystem1 = part_system_create_layer("BottomParticleLayer", false);
particle1 = part_type_create();
part_type_shape(particle1,pt_shape_ring);
part_type_size(particle1,0.10,0.38,-0.19,1);
part_type_scale(particle1,1.66,2.86);
part_type_color3(particle1,7147325,732674,10545510);
part_type_alpha3(particle1,0.81,0.31,0.09);
part_type_speed(particle1,1.36,2.68,-0.26,4);
part_type_direction(particle1,124,248,-1,0);
part_type_gravity(particle1,0,270);
part_type_orientation(particle1,28,219,0.40,4,0);
part_type_blend(particle1,1);
part_type_life(particle1,32,49);
Game End event:
///Destroy System Prevent leaks
part_system_destroy(DGpartSystem1);
part_type_destroy(particle1);
Script DG_particle1
///DG_particle1(x,y)
var xx = argument0;
var yy = argument1;
part_particles_create(obj_DGparticleSystem1.DGpartSystem1, xx, yy, obj_DGparticleSystem1.particle1, 1);
Calling the script:
DG_particle1(x,y);
to call it with the mouse:
if (mouse_check_button(mb_left)) DG_particle1(mouse_x,mouse_y);
If you've enjoyed this video please consider giving it a Like, Favorite and share. You could always Subscribe to the channel if you haven't already and as always, thanks for watching and we'll see you in the next video! :)
DG Discord Server:
https://discord.gg/YcxySsj
Website:
http://driftwoodgaming.com
Twitch:
http://www.twitch.tv/DriftwoodGaming
Twitter:
http://www.twitter.com/DriftwoodGaming
Patreon:
http://www.patreon.com/DriftwoodGaming
-------------------------------
Special thanks to all my Patrons:
Damian Floyd, Fun4theBrain, David Philips, Studio Blue, Battle Pisces Gaming, Michael Flynn, John Gibson, ChrAndGow, Scott Zarwell, Edwardo Santizo, NeoSoulGamer, Jai R Fisher, Rusty_Gears, Meteodros, R.A.M, Valryia, DarkKrow13, StalkerRoguen, Ervin Mcclure, Chris Van Essen, Mithrandir, Michael Noles and those of you who have supported me in the past.
Other Videos By Driftwood Gaming
Other Statistics
RPG Maker MV Statistics For Driftwood Gaming
At this time, Driftwood Gaming has 4,379,079 views for RPG Maker MV spread across 926 videos. His channel uploaded over 32 days worth of RPG Maker MV videos, roughly 50.43% of the content that Driftwood Gaming has uploaded to YouTube.