GameMaker Arcade Space Shooter • Classroom Tutorial
Student-friendly adaptation of the GameMaker “Make Your Own Arcade Space Shooter” tutorial
Build a simple Asteroids-style arcade game in GameMaker. You will create a player ship, bullets, moving rocks, collisions, a restart system, and a score display.
PX_lastname_Rocks.YOUR 2026_27KleinCollins\P?_Video on Google Drive, not on your local hard drive.The Asset Browser should contain a player sprite, a bullet sprite, and large/small rock sprites.
In the Asset Browser, create the following objects and assign sprites as shown:
| Object | Sprite | Purpose |
|---|---|---|
obj_player | spr_player | The ship controlled by the player |
obj_bullet | spr_bullet | Projectile fired by the ship |
obj_rock | spr_rock_big | Asteroid/rock target |
obj_game | None | Controls restart timing and score |
obj_player instance into the room.obj_rock instances into the room.Open obj_player and add a Step event. The Step event runs continuously while the object exists.
if (keyboard_check(vk_up))
{
motion_add(image_angle, 0.1);
}
When the Up Arrow is held, the ship receives a small amount of motion in the direction it is facing.
if (keyboard_check(vk_left))
{
image_angle += 4;
}
if (keyboard_check(vk_right))
{
image_angle -= 4;
}
Changing image_angle rotates the ship. Adjust the value 4 if you want faster or slower turning.
move_wrap(true, true, 0);
This allows the ship to leave one side of the room and reappear on the opposite side.
In the obj_player Step event, create a bullet when the left mouse button is pressed:
if (mouse_check_button_pressed(mb_left))
{
instance_create_layer(x, y, "Instances", obj_bullet);
}
The bullet is created at the player’s current x/y position on the Instances layer.
Open obj_bullet and add a Create event:
speed = 10;
direction = obj_player.image_angle;
The bullet moves quickly in the direction the player is facing when it is created.
Add an Other → Outside Room event to obj_bullet:
instance_destroy();
Removing bullets after they leave the room prevents unnecessary instances from accumulating.
Open obj_rock and add a Create event:
speed = 1;
direction = random(360);
image_angle = random(360);
Each rock starts with a random movement direction and a random visual rotation.
Add a Step event to obj_rock:
move_wrap(true, true, 100);
image_angle += 1;
The 100-pixel margin lets a rock travel fully off-screen before wrapping, which makes the transition less noticeable.
In obj_rock, add a Collision event with obj_bullet. First destroy the bullet,
create an effect, and choose a new movement direction:
instance_destroy(other);
effect_create_above(ef_explosion, x, y, 1, c_white);
direction = random(360);
Then change the rock based on its current size:
if (sprite_index == spr_rock_big)
{
sprite_index = spr_rock_small;
instance_copy(true);
}
else if (instance_number(obj_rock) < 12)
{
sprite_index = spr_rock_big;
x = -100;
}
else
{
instance_destroy();
}
In obj_player, add a Collision event with obj_rock:
effect_create_above(ef_firework, x, y, 1, c_white);
instance_destroy();
obj_game.alarm[0] = 120;
The player explodes, the ship instance is destroyed, and Alarm 0 in obj_game starts a 120-frame countdown.
At 60 FPS, 120 frames is about two seconds.
Open obj_game and add Alarm 0:
room_restart();
Place one obj_game instance in Room1. It has no sprite, so its location does not matter.
In obj_game, add a Create event and initialize the score:
points = 0;
Add a Draw GUI event to obj_game:
draw_text(10, 10, points);
The Draw GUI event is useful for HUD information because it is drawn over the game view.
In the obj_rock collision event with obj_bullet, add this outside the size-check conditions:
obj_game.points += 50;
Each destroyed rock adds 50 points.