Book Image

GameMaker Programming By Example

By : Brian Christian, Steven Isaacs
Book Image

GameMaker Programming By Example

By: Brian Christian, Steven Isaacs

Overview of this book

This book is excellent resource for developers with any level of experience of GameMaker. At the start, we’ll provide an overview of the basic use of GameMaker: Studio, and show you how to set up a basic game where you handle input and collisions in a top-down perspective game. We continue on to showcase its more advanced features via six different example projects. The first example game demonstrates platforming with file I/O, followed by animation, views, and multiplayer networking. The next game illustrates AI and particle systems, while the final one will get you started with the built-in Box2D physics engine. By the end of this book, you have mastered lots of powerful techniques that can be utilized in various 2D games.
Table of Contents (16 chapters)

Customizable controls


The final system we will be incorporating into our game is one through which players can customize and save their keybinds so that they are different from the left and right arrow keys and the Enter key. We will only put in a binding system for these keys, but it is quite easy to extend the system to include other keys, such as the one for pause, and moving the selection up and down on a menu. The keybinds will be saved to our .ini file whenever the game is closed, and loaded back in at its very start.

So let's begin putting it in! First, make another button sprite, just like the others that we made, but it will be for modifying the keybindings. When you've finished that, open up the pause menu object. The majority of our code for the keybindings system will be programmed in here, as creating another object could make things complicated.

First, we'll be setting a variable in the Create event of our pause menu object. Set binding to false. This is to tell if we are currently...