GameMaker Arcade Space Shooter • Classroom Tutorial

Make Your Own Arcade Space Shooter

Student-friendly adaptation of the GameMaker “Make Your Own Arcade Space Shooter” tutorial

Goal

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.

Stage 1
Move the ship
Stage 2
Shoot and destroy rocks
Stage 3
Finish the game loop and scoring

1. Create the Project

  1. Open GameMaker and choose New.
  2. Select the Space Rocks template so the starter sprites are already available.
  3. Enter a project name and create the project.
  4. Your file name will be PX_lastname_Rocks.
  5. Save this under 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.

2. Create the Game Objects

In the Asset Browser, create the following objects and assign sprites as shown:

ObjectSpritePurpose
obj_playerspr_playerThe ship controlled by the player
obj_bulletspr_bulletProjectile fired by the ship
obj_rockspr_rock_bigAsteroid/rock target
obj_gameNoneControls restart timing and score

3. Prepare the Room

  1. Open Room1 in the Room Editor.
  2. Set the room width and height to 1000 × 1000 pixels.
  3. Select the Instances layer.
  4. Drag one obj_player instance into the room.
  5. Drag about six obj_rock instances into the room.

4. Move the Player Ship

Open obj_player and add a Step event. The Step event runs continuously while the object exists.

Forward movement

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.

Turning left and right

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.

Wrap around the room

move_wrap(true, true, 0);

This allows the ship to leave one side of the room and reappear on the opposite side.

Checkpoint

5. Fire Bullets

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.

6. Program the Bullet

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.

Destroy bullets outside the room

Add an Other → Outside Room event to obj_bullet:

instance_destroy();

Removing bullets after they leave the room prevents unnecessary instances from accumulating.

7. Make the Rocks Move

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.

Rock wrapping and spinning

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.

8. Bullet vs. Rock Collision

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();
}

Game logic

9. Player Collision and Game Restart

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.

Restart the room

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.

10. Add a Score

In obj_game, add a Create event and initialize the score:

points = 0;

Display the score

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.

Increase the score

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.

11. Final Testing Checklist