StarterVillage

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.

MiniQuest_W1_Start.zip · 26 MB

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

The GameMaker workspace, with panels for the room, the asset browser, and the player object, and the pixel-art hero placed in a green room.

Getting to know the GameMaker workspace, where the art, characters, rooms, and code all live.

Getting to know the GameMaker workspace, where the art, characters, rooms, and code all live.
GameMaker code in the player's Step event: reading the arrow keys to move, facing the way the hero walks, and animating while moving.

The real code your learner writes to walk the hero up, down, left, and right.

The real code your learner writes to walk the hero up, down, left, and right.

Optional Customizations

Just-for-fun customizations to try on your own between classes. Never needed to keep up.

  1. Choose your hero - swap the frog for a knight or a ninja.

    Don't want to be a frog? Two quick changes turn your hero into someone else. First, open obj_player and click its Sprite box (top-left of the object editor), then pick your new hero's down sprite, like spr_knight_grey_walk_down. That is what the room editor shows, so your hero looks right before you even press Run.

    The obj_player object editor in GameMaker with the Select Sprite window open, choosing a knight sprite from the Heroes folder.

    Next, open the Create event and point your four costume variables at the new hero (and set the starting sprite_index to match):

    walk_down  = spr_knight_grey_walk_down;
    walk_up    = spr_knight_grey_walk_up;
    walk_left  = spr_knight_grey_walk_left;
    walk_right = spr_knight_grey_walk_right;
    sprite_index = walk_down;
    The obj_player Create event in GameMaker, with the four walk_down, walk_up, walk_left, and walk_right costume variables and the starting sprite_index highlighted.

    Your Step code already tells the hero to wear walk_right, walk_left, and the rest, so your new hero walks with the exact same controls. Press Run, then post a screenshot of your hero in the classroom!

  2. Set your own walking speed.

    Open obj_player and click its Create event. One line decides how fast your hero moves:

    spd = 2;
    The obj_player Create event in GameMaker, with the line spd = 2; highlighted.

    Change the number, then press Run to feel it. Try 0.5 for a careful explorer, then 4 for a speedster. What speed feels right for your adventure?