Create a Time Line Object in GameMaker: Studio - dummies

Create a Time Line Object in GameMaker: Studio

By Michael Rohde

In GameMaker: Studio, you can build a Time Line that you then place in a Room for your game. You can think of the levels in your game as a different Room that contains a different Time Line.

In that sense, you can create multiple Time Lines within multiple Rooms that the player can transition to as they complete each level. You will also need to learn how to do the transitioning, but for now, here’s how to create a new Room and an Object for a Time Line.

When making a game with multiple rooms, GameMaker makes it easy for you to duplicate a Room and then remove all Instances from that duplicated Room so that you can start fresh, but with the same Room parameters.

To remove all Instances from a Room, choose the icon that looks like a white rectangle from the icon menu while in the Room Properties window, as shown here.

The Clear All Instances from the Room icon in the Room Properties window.
The Clear All Instances from the Room icon in the Room Properties window.

To create an Object for the Time Line, which you’ll place in the Room, follow these steps:

  1. From the main menu, choose Resources→Create Object.

    The Object Properties window appears.

  2. In the Name field, type in, say, obj_timeline.

  3. Choose Add Event→Create.

    A Create Event appears in the Events section.

  4. From the main2 tab, drag and drop a Set Time Line Action into the Actions section.

    The Set Time Line Action properties window appears (see the next figure).

  5. In the Applies To section, select the Self radio button.

  6. From the Time Line drop-down list, select, say, TimeLine0.

  7. In the Position field, leave the default at 0.

  8. From the Start drop-down list, choose Start Immediately.

  9. From the Loop drop-down list, choose Don’t Loop.

  10. Choose OK to save and close.

    The Set Time Line Action properties window is saved.

    The Set Time Line Action properties window.
    The Set Time Line Action properties window.

You’ve created an Object for the Time Line you created earlier. You can place an Instance of this Object in a Room, so that your Time Line is triggered during the game.