Create a Time Line Object in GameMaker: Studio
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.
To create an Object for the Time Line, which you’ll place in the Room, follow these steps:
From the main menu, choose Resources→Create Object.
The Object Properties window appears.
In the Name field, type in, say, obj_timeline.
Choose Add Event→Create.
A Create Event appears in the Events section.
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).
In the Applies To section, select the Self radio button.
From the Time Line drop-down list, select, say, TimeLine0.
In the Position field, leave the default at 0.
From the Start drop-down list, choose Start Immediately.
From the Loop drop-down list, choose Don’t Loop.
Choose OK to save and close.
The Set Time Line Action properties window is saved.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.