Adding an Effect Action to Your GameMaker: Studio Game
With GameMaker: Studio, you can create video games using simple drag-and-drop Actions. For example, let’s say you made a scrolling shooter game. In that game, you decided to use Sprites (a Sprite is an image or series of sub-images) to represent the explosion when an enemy is blown up. But what if later you decide you want the explosion to be more special? In that case, you can create particles to create an explosion effect.
Here’s how to add a drag-and-drop Effect Action for use as an explosion. The following procedure assumes that you’ve already made your game and you simply want to update your explosion effect from using a Sprite to using an Effect Action. It also assumes you’re already familiar with GameMaker: Studio and that perhaps you’ve completed the Scrolling Shooter tutorial and are looking to upgrade your game.
The Effect Action makes use of particles. Particles have many benefits, including blending and faster processing.
To update your explosion from a Sprite to an Effect, follow these steps:
Open the Object that you want to update, such as obj_enemy.
The Object Properties window appears.
Select the Collision Event from the Events section.
The Actions for the Collision Event appear in the Actions section.
Right-click the Create Instance Action for, say, obj_explosion, and click Delete.
This removes the Sprite explosion from being displayed.
Drag and drop a Create Effect Action from the Draw tab to the Actions section.
The Create Effect Action window appears.
In the Applies To section, click Self.
From the Type drop-down list, choose the desired explosion effect.
You can also leave the default of Explosion.
From the Color drop-down list, choose, say, a red color from the color graph.
Select the Relative check box.
You want the effect to appear where the Object was, and that’s why you don’t update the X and Y fields.
The Create Effect Actions window is saved and closed.
In the following screenshot, the Sprite explosion is on the left and the Create Effect explosion is on the right.