Create a Time Line in GameMaker: Studio

By Michael Rohde

When using Time Lines in GameMaker: Studio, you need to become familiar with how X and Y coordinates work, which is how you place Instances of Objects in the Room. At first, using Time Lines may seem like an arduous task of determining X and Y coordinates as opposed to placing the Instances in the Room by hand (as you do when using Views).

However, after you’ve set up an enemy fleet of planes, the Time Line provides an extremely flexible way to quickly change when the enemy planes appear by simply updating the Step number.

When you manually place the planes using Views, you have to go back and select each plane and then move them up and down the Room to change when they appear. There are trade-offs to each method — you’ll learn through experience when it’s the best time to use the different techniques.

Using Time Lines to create and control enemy behavior gives you significant control over how your game plays. The in-software Scrolling Shooter tutorial begins by showing how to create a game using a random generator for the enemy planes.

This creates a challenging game in that it continuously gets harder over time, but there are problems with that approach, such as planes overlapping each other. Time Lines can help solve that problem.

When you use Time Lines, you present the player with the same pattern of enemy planes each time they play the game. It provides players with an opportunity to learn the game, so they can play it better over time. This gives players a sense of satisfaction — which is important, because they’ll want to continue playing your game!

When working with Time Lines, you use Time Line resources; within each Time Line resource, you specify a number of Moments in time (measured in steps of the game); and for each Moment, you create an Action. For example, you can create Time Line resources that control when enemy planes appear. The planes should be destroyed when they leave the Room and not reappear.

Just like with creating a Sprite, Object, or Sound, there are multiple ways to create a Time Line. You can do so from the main menu (Resources→Create Time Line), from the icon menu, or by right-clicking Time Lines from the Resource tree and choosing Create Time Line.

When you create a Time Line, you work with the Time Line Properties window, which looks similar to the Object Properties window. You can name the Time Line, you can add Moments (as compared to Events when working with Objects), and to those Moments you drag and drop Actions from the tabs.

The Time Line Properties window.
The Time Line Properties window.