O'Reilly logo

GameMaker Game Programming with GML by Matthew DeLucas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting the environment – backgrounds

Vlad is currently being followed by a camera of some sort, but he still doesn't really fit into an environment. One reason for this is the lack of a background; in this section, a background resource will be created that will be moved by obj_camera and hopefully will give the game a better sense of setting.

Introducing background variables

Before jumping to the creation of a background resource or related scripts, variables associated with backgrounds will be discussed. Backgrounds' parameters are very similar to views', as their parameters are accessed through an array. The following code sample showcases these different parameters:

// The Resource id of the specified background. background_index[0] = bg_main ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required