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 screen-shake


One of my favorite effects, screen-shake, is a great way to add some depth and excitement to your game. As you may have guessed, I'm referring to the visual effects of making the screen-shake in order to simulate the effect of a shock or impact. Game developers, Vlambeer, know how to add excitement to games, such as Luftrausers and Nuclear Throne, by correlating the action with screen-shake; if you get hit or an explosion goes off, you'll know it. Let's see how we can add screen-shake using GameMaker.

Getting ready

Screen-shake often takes place when an explosion occurs on screen, making this recipe a perfect follow up to the previous one. Let's add on to the particle recipe using the same project file. In order to show off the effect, you'll need to add some visible objects to the background. This will allow you to see the screen moving back and forth. I added several instances of obj_block, which has a simple 32 x 32 square for its sprite. There's no need to make changes...