Learn GameMaker Studio the right way: objects, events and GML code. Build Pong with two paddles, a bouncing ball, scoring and an AI, the engine that shipped Undertale, in your hands.
GameMaker’s building blocks: sprites, objects, rooms
Active
🎯
Goal for this step
Create the project and understand GameMaker’s core concepts.
1Install GameMaker (gamemaker.io), the free tier covers this whole series. New Blank project, name it Pong.
2The three building blocks: Sprites (images), Objects (things with behaviour), Rooms (levels containing instances of objects).
3Make a sprite: spr_paddle, 16×96, filled white (the built-in editor is fine).
4Make an object: obj_paddle, assign spr_paddle.
5Open Room1, set it 800×500 with a dark background, drag obj_paddle in near the left edge. Run (F5), your paddle exists in a window!
👨👧
Parent note: GameMaker’s free licence is enough for the entire series; it only limits some export platforms. GML is a friendly first "real" language, Undertale and Chicory shipped with it.
✏️
Fill in the Blanks
+15 XP
GameMaker’s three core assets are sprites, and rooms. A copy of an object placed in a room is called an . The run key is .
🧠
Knowledge Check
+15 XP
The difference between an object and an instance is…
ASpelling
BThe object is the blueprint; instances are copies living in the room, one obj_paddle, two paddles
CObjects are bigger
2
⚡
Events & Your First GML
Step events and keyboard_check
Locked
🎯
Goal for this step
Move the paddle with GML code in the Step event.
1Objects respond to Events: Create (born), Step (every frame, 60/s), Draw, collisions and more.
2In obj_paddle: Add Event → Step, and write the movement code below.
3keyboard_check is true while held; y is the built-in vertical position; clamp keeps it on screen in one call!
4GML reads like simple English-maths. Run it and slide the paddle.
obj_paddle · Step Event
// move with W and S
if (keyboard_check(ord("W"))) y -= 6;
if (keyboard_check(ord("S"))) y += 6;
// stay on screen (48 = half the paddle height)
y = clamp(y, 48, room_height - 48);
⌨️
Code Challenge
+20 XP
Complete the paddle movement and clamp:
obj_paddle · Step
if (keyboard_check(ord("W"))) y 6;
if (keyboard_check(ord("S"))) y += 6;
y = (y, 48, room_height - );
💡 Hint: W moves up (y shrinks). GML has a one-call min/max limiter. The margins are half the paddle height at each end.
🧠
Knowledge Check
+15 XP
The Step event runs…
AOnce when the game starts
BEvery frame, ~60 times per second, it IS the game loop, per object
COnly when a key is pressed
3
⚪
The Ball: hspeed & vspeed
Built-in motion and wall bouncing
Locked
🎯
Goal for this step
Launch a ball with built-in speed variables and bounce it.
1Make spr_ball (16×16 white square) and obj_ball.
2GameMaker objects have motion BUILT IN: set hspeed and vspeed in the Create event and the instance moves itself, no position code needed!
3Bounce off top/bottom in Step: if the ball is past an edge, flip vspeed.
4choose(-4, 4) is GML’s coin flip, a random serve direction each run.
5Drop obj_ball in the room centre and run: it flies and bounces.