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

Setting up a basic HUD with code


Have you ever played a game and stopped to think, "Gee, I wish I knew what my score was!" No? That's probably because your score, health, and other important pieces of information are presented to you on the screen at any given moment. Now, this isn't the case for all games; of course, but it's true for classic and arcade games. Pac-Man and Mario will always tell you how many lives you have left with because it's important to have this information. Let's take a look at how we can display such information by making a simple game.

Getting ready

You'll need a few things before we can really begin. Firstly, you'll need to create a room called rm_game. You'll also need four objects: obj_display, obj_gameControl, obj_base, and obj_enemy. The last two will require sprites. You'll also need to set up a new font. This does not need to be a custom font designed by you. Simply, click on the Create a font button on the toolbar, select the font you wish to use to display...