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

Preparing the game for obj_camera

Now that the basic view parameter variables have been covered, the camera object can be made. Only one new object resource needs to be created; this object resource will be named obj_camera. It will have a Create event and an End Step event. The Create event will mostly define variables, while the End Step event will be used to actually move the camera.

The Create event

As with many of the object resources previously created in this book, the Create event of obj_camera will define a variety of variables. The following script will be executed by the Create event:

/// Initializes variables for the camera. // The index of the view that will be manipulated. view_index = 0; // The left most limit that the camera can move. ...

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