O'Reilly logo

GameMaker Essentials by Nathan Auckett

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

Programming the game

With our object created and ready to go, we are now also ready to program the game and make it work. All this will be done in the player object.

Add a Create event to the player object and then drag in a code block from the control tab on the right. You can actually change the default tab for objects in the GameMaker preferences.

Programming the game

The first thing we need to do is think about what variables we are going to need. We are going to make the game record the score, so we will need a variable for this. To make the code easier to edit, we can also create a variable for storing the maximum speed we want the player to move at. Finally, we ...

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