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)

A physics game


In this section, we will program a small physics sandbox. We're not going very in-depth, as this is intended to be a small introduction to the physics engine, not a complete tutorial. Let's first explain some information that you'll need to know when you're using GameMaker's physics engine. For one, you should not mix physics-specific code with code that controls movement that doesn't use physics (for example, use physics speed variables rather than the variable speed). It's also important to limit how many physics instances are active at once in your game, as they use intense calculations to make everything flow properly. In relation to this, use parenting for collision checks—children will not inherit physics properties, but they can inherit collision events. If you had five different enemies, it's best to have your player check for a collision with a parent rather than all five of those different enemies, if you can.

But anyway, let's start with making our physics game....