Week 1
Your Hero Comes to Life
Part of Make Your First Mini-Game.
Our very first class is all about getting comfortable in GameMaker and bringing a hero to life. By the end of the hour your learner has a character they coded themselves, walking and animating around the screen.

Class file
Download your course file here
This is the project your learner starts from in the very first class. Download it ahead of time so they can dive right in. Enrolled students get the password in their Outschool welcome message.
What this class covers
- Getting to know GameMaker
- A friendly tour of the workspace, the same professional tool used to make real games, so your learner knows where the art, the characters, the rooms, and the code all live before we start building.
- Putting a hero on screen
- Your learner creates their hero and places it into the forest clearing, ready to control.
- Moving in four directions
- Your learner writes the code that reads the keyboard and walks the hero up, down, left, and right.
- A walk that feels alive
- The hero turns to face the way it is going and animates as it moves, then settles on a standing pose when it stops.
A look inside the class
Bonus challenges
Optional, just-for-fun challenges to try on your own between classes. Never needed to keep up.
- Tune the hero's walking speed.
Open obj_player and click its Create event. One line decides how fast your hero moves:
spd = 2;Change the 2 to a new number, then press Run to feel it. Try 0.5 for a slow tiptoe, then 4 for a zoom. What speed feels right for a forest adventure?
- Add WASD controls alongside the arrow keys.
Right now only the arrow keys move your hero. Let's make W, A, S, and D work too. In the Step event, find the two lines that start with var move_x and var move_y, and swap them for these:
var move_x = keyboard_check(vk_right) - keyboard_check(vk_left) + keyboard_check(ord("D")) - keyboard_check(ord("A")); var move_y = keyboard_check(vk_down) - keyboard_check(vk_up) + keyboard_check(ord("S")) - keyboard_check(ord("W"));Press Run. Now the arrow keys and WASD both work. Pressing D or Right each send your hero to the right.
- Add a run key: hold Shift to go faster.
Let's make your hero sprint when you hold Shift. In the Step event, just under those two var move_ lines, add this:
// Hold Shift to run - 1.5x your normal speed. var run_spd = spd; if (keyboard_check(vk_shift)) { run_spd = spd * 1.5; }Then change your two movement lines so they use run_spd instead of spd:
x += move_x * run_spd; y += move_y * run_spd;Press Run and hold Shift to dash. It runs at 1.5x whatever speed you picked, so it still works even if you changed spd in the challenge above.
- Swap in a different hero, like a knight or a ninja.
Trade the frog for a different hero from the art pack. First, open obj_player and set its Sprite (the box at the top-left of the object editor) to your new hero's down sprite, like spr_knight_grey_walk_down.
Then, in the Step event, change the four sprite names in the facing block to match your new hero:
if (move_x > 0) sprite_index = spr_knight_grey_walk_right; else if (move_x < 0) sprite_index = spr_knight_grey_walk_left; else if (move_y > 0) sprite_index = spr_knight_grey_walk_down; else if (move_y < 0) sprite_index = spr_knight_grey_walk_up;Press Run - your new hero walks with the exact same controls. Snap a screenshot and post it in the classroom!
- Extra tricky: lock the hero to four directions.
Have you noticed your hero moves a little faster diagonally? Pressing two arrows at once slides you sideways and up or down at the same time. Let's lock movement to just up, down, left, and right, like the classic adventure games. This one is a real brain-stretcher!
First, your hero needs to remember which way it committed to. In the Create event, add one more line:
last_axis = ""; // which direction we're committed to: "h" or "v"Then, in the Step event, right after the two var move_ lines (and before the x += lines), add this:
// 4-directional, first key wins: if both are pressed, keep the axis we were already on. if (move_x != 0 && move_y != 0) { if (last_axis == "v") move_x = 0; // committed to vertical first else move_y = 0; // otherwise keep horizontal } // Remember this frame's axis, so next frame knows what we committed to. if (move_x != 0) last_axis = "h"; else if (move_y != 0) last_axis = "v";Press Run. Now your hero locks to four directions, and whichever arrow you press first wins until you let go, and that sneaky diagonal speed boost is gone too.