Easy Explosions (Game Maker)


Game Maker 6.1 comes with two easy ways to show an explosion when an instance is destroyed. One is a new action called Create an effect. The second way is the corresponding functions, effect_create_above() and effect_create_below() .

This tutorial will deal with the action. If you program with GML and want to use one of the functions, you can easily adapt the information in this tutorial for use with them, or see their individual pages for more information on how they work.

This tutorial is for Game Maker 6.1 registered.

Easy Explosions

In the Destroy event of the object you want to explode, drag the "Create an Effect" action into the action list. You can find it in the Draw tab, at the bottom, in the section labeled "Other". It looks like an explosion. The "Create an Effect" action window will pop up.

In the type box, choose "explosion". It is set to "explosion" by default, so you shouldn't have to change anything.

The values you put in the x and y box will depend on where the origin of the sprite of your object is.

By default, it is in the top-left corner, so if you haven't changed it, you can put this in the x and y boxes:

x : x + sprite_width / 2 
y : y + sprite_height / 2

If you have centered the origin of the sprite, simply put x and y in their respective boxes.

Leave the size box as it is for now. After you have seen the actual size in relation to your object after is has been destroyed, you can change it to suit the size of your object.

In the color box, choose a red color.

In the where box, choose above objects.

Now, save your game and test it out. You know everything you need to know to make an object explode.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution 2.5 License.