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

Moving characters or objects by tilting a device


Another widely used feature in smartphones and tablets is the built-in gyroscope. This component allows basic motion controls that are read by their movement. The most common use of device tilt is to control the screen's visual orientation, but it can also be used for games. We're going to take a look at how to use tilt controls to move an object around.

Getting ready

Before we begin, you'll need to set up your room for a mobile device. As we'll test tilt functions that utilize an accelerometer, this recipe can only be tested on a mobile device, such as a smartphone or tablet. With the purchase of a GameMaker Professional license, you can test them on Android devices without purchasing the exporter. If you wish to test on iOS or Windows mobile devices, you'll need to purchase their respective export licenses. For this recipe, I used the Android target in portrait mode for testing purposes. I set the room to 768 px wide by 1280 px high and locked...