Welcome to Part 1 of the Hero’s Trail tutorials!
Welcome to Hero’s Trail, a simple and fun tutorial for new GameMaker Studio 2 users! This series demonstrates all the amazing things you can do with GameMaker at a basic level and allows you to learn all the ins and outs of the program while developing your own action-adventure game.
We’ll now use the Hero’s Trail template project to get a quick introduction to the world of GameMaker, and in subsequent parts we’ll build upon this basic demo to create our own fully-fledged action-adventure game!
This tutorial is divided into the following sections:
The Hero's Trail template project can be used as a starting point for new projects.
When you open GameMaker Studio 2, click on "New" to see the Template menu. Then select the "Hero's Trail Base - DnD" project, enter your project name & directory and hit "Let's Go!".
This will open your new project where you can modify the template and play it. To play the game you can click on the Run button at the top, or press F5 on your keyboard:
This will open the game in a new window, where you can click “Play” and move around the level using the arrow keys:
This is the base project that we'll build upon to create our own fully featured action-adventure game!
After you’re done exploring, close the game window and we'll take a look at the GMS2 IDE (“Integrated Development Environment”, or simply put, the program’s user interface!).
The GMS2 IDE consists of two main parts: the Workspace and the Asset Browser.
This is where you edit assets, such as your images, objects, levels and more.
This is where your assets are created and listed, and double-clicking on any asset here opens it up in the Workspace.
You can open multiple workspaces as tabs, similar to tabs in an
You will see many folders in the Asset Browser, which are called
“groups”. You can expand a group and see the assets inside
Games are made using ‘assets’ which are the building blocks of your games: any images, objects and levels are created as assets and can be edited inside the workspace.
Your final game will be made up of many different kinds of assets:
There are three types of assets that are most crucial in GMS2:
A Sprite is an image that can be used anywhere in the game (e.g.: for objects, backgrounds, animations, etc.).
An Object can be used as an interactive element in your game, such as the player, an enemy, a coin, etc.
A Room serves as a specific screen in your game, such as a level or the main menu.
Let’s look at a sprite asset in the Hero’s Trail project.
In the Asset Browser (on your right), open the “Sprites” group and then open the “Baddie” group.
Here you will find different kinds of sprites for the enemy under the “Attack” and “Idle_Walk” groups.
In the “Idle_Walk” group, double click on the spr_baddie_idle asset to open it in the Workspace.
You will see the Sprite Editor open up in the Workspace, where you can preview each frame of the animated sprite and hit Play to see the baddie in action!
This is just one of the many “asset editors” in GameMaker. You can now close this, or if you want to start tinkering with the project already, you can click on either “Edit Image” to modify this sprite or draw on it, or “Import” to load any other image file you want.
When do we start making things?!
We’re getting there -- we’re going to look at objects and rooms next to learn how and why GameMaker works, but if you can’t wait to start adding new features, you can scroll to the bottom of the page and continue to the next part.
It is recommended to read this page before continuing, unless you are already familiar with the basics of GameMaker Studio 2.
You can use objects to create interactive elements in your games, such as enemies, barrels, coins, and so on. There is a basic workflow that you can use to create such objects.
First create a Sprite, which serves as the image for your object. This can be an animation too.
Then create an Object and add “Events” to it. Events allow the object to respond to player input or perform its own behaviour.
Finally, place the Object inside a Room (which is a level), which creates an Instance of that object. You can place multiple instances of an object in a room (allowing you to place multiple enemies and coins).
This workflow can be simplified as shown below:
It’s super easy to create a new sprite and even draw your own image right inside GameMaker Studio 2! Here’s how you can create a new sprite asset:
Go to the "Create Asset" menu at the top of the Asset Browser.
Select “Sprites” and click on “Create” (or just double-click on the “Sprites” button).
This will create a new Sprite asset in the Asset Browser and allow you to give it a name.
You can then drag the asset and place it into any of the existing groups, or right-click in the Asset Browser and select “Create Group” to add a new group for your assets.
If you select a group before creating an asset, the new asset will be created inside the selected group.
In the new sprite's Sprite Editor window, you can resize the sprite and then select “Edit Image” to draw on it:
Doing this will open the Image Editor, where you can use the various drawing tools to create and animate something entirely new!
Levels are created using Room assets, and the Hero’s Trail project already has a few rooms, one of which is the first level that opens when you play the game.
We’ll open this room and move a few things around so we can get a hang of the Room Editor!
In the Asset Browser, expand the “Rooms” group and double-click on rm_level_1:
This will open the Room Editor, which has the following main parts:
The Room Canvas is where you will edit your level, and on the left you have various menus for managing layers and the room itself.
The Layers panel contains all the layers in the room, and each layer simply contains assets (such as sprites, tiles, and object instances). We’ll focus on one of these layers and move some things around:
In the Layers panel, scroll down and select the “Instances” layer.
This is an Instance Layer where you can place instances of objects, such as the player, enemies, barrels, etc..
Once you have the layer selected, you can go into the room area, select the player, an enemy or a barrel and move it anywhere you like!
NOTE: Moving the enemies may not change the path they walk on. Changing and creating enemy paths is covered in Part 4 of the tutorial.
When you have the “Instances” layer selected, you can drag objects from the Asset Browser into the room to create new instances!
Tiles are essentially non-interactive images that are placed around the room, and unlike sprites, they’re grouped into a single asset known as a “Tile Set”.
Here is one of the Tile Sets in this project (present in the “Tile Sets” group):
You can see that it contains multiple tiles (square images), which is why it's called a "Tile Set".
This Tile Set is used for the floor of a level, appearing below the player. You can actually go in the room and edit these tiles right now:
Open the rm_level_1 room.
In the Layers panel, expand the “Visuals_Below_Instances” folder.
Select the “Tiles_Floor” layer. This is a Tile Layer that uses the Tile Set shown above and displays the floor tiles.
You can now select a tile from the panel on the right side of the IDE, and place it anywhere in the room. You can also right click to remove a tile (or use the eraser tool from the Toolbox at the top).
If you would like to read more about the Sandbox project and its assets in detail, please see the Hero’s Trail Project Breakdown.
We’ll now customize this project and develop our own game out of it, complete with sword attacks, interactive level elements such as chests and gates, power ups, abilities and much more!
All Hero's Trail tutorials will demonstrate Drag and Drop™ action blocks using screenshots, where you will have the actual actions on the left (which is how you need to organise them), and comments on the right explaining what each action does.
Here is an example of such a screenshot:
While there will also be explanations within the tutorial text itself, it is recommended that you pay attention to the comments attached to each action in a screenshot.