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)

Creating the main ship


The first step in our game will be to create our main ship, controlled by the player. Make a new GameMaker project. We're going to make this game in a little retro style, so draw two subimages for your main ship's sprite, one for forward, and one for tilting right (which we will repurpose for tilting left with image_xscale). Typically in games of this style, no extra sprite will exist for moving downward, and it will use the same one as for moving forward. The subimages should be 32 x 32, to make some things easier later on. When creating your ship, give it two guns, one on each side. An example is shown as follows:

Once you have made your ship's subimages, modify the sprite's bounding box as usual, and also make sure to center the origin (on both axes) so that we don't run into any issues with image_xscale and so that we can easily program the vertical movement, accounting for going off of the screen. After this, create the object for your main ship and assign it the...