Book Image

GameMaker Cookbook

Book Image

GameMaker Cookbook

Overview of this book

GameMaker: Studio started off as a tool capable of creating simple games using a drag-and-drop interface. Since then, it has grown to become a powerful instrument to make release-ready games for PC, Mac, mobile devices, and even current-gen consoles. GameMaker is designed to allow its users to develop games without having to learn any of the complex programming languages such as C++ or Java. It also allows redistribution across multiple platforms. This book teaches you to harness GameMaker: Studio’s full potential and take your game development to new heights. It begins by covering the basics and lays a solid foundation for advanced GameMaker concepts. Moving on, it covers topics such as controls, physics, and advanced movement, employing a strategic approach to the learning curve. The book concludes by providing insights into complex concepts such as the GUI, menus, save system, lighting, particles, and VFX. By the end of the book, you will be able to design games using GameMaker: Studio and implement the same techniques in other games you intend to design.
Table of Contents (17 chapters)
GameMaker Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding a game over screen


How do you know when you've lost the game you're playing? Well, if you're playing the game we've been creating in this chapter, you will know this because it resets itself. Not very appealing from a player's standpoint, right? Most games will show you a game over screen that will, at the very least, tell you that your gameplay session has finished. Let's take a look at creating a game over screen and what information we can convey to the player.

Getting ready

We're going to finish our game with a game over screen, so make sure that the project file is open. You'll need a few things before we begin, so let's take a look at the list. First, you'll need a new room called rm_gameOver. You'll also need a controller object called obj_gameOverCtrl as well as objects called obj_btn_exit and obj_btn_restart. We'll be reusing obj_btn_quit, but this will be available since we're using the same game project.

How to do it

  1. In rm_gameOver, open the creation code and enter the following...