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

Simulating rainfall


One thing I enjoy is when a game developer adds some small touches to increase the player's immersion in the game's world. How can you go about doing this? Why not add some real-world elements to start with? Let's try making it rain. By this, I mean simulating drops of water falling from the sky, not tossing dollar bills in slow motion; though this would also be cool.

Getting ready

The following recipe is incredibly easy and illustrates another way in which you can use GameMaker's built-in simple particle effects. We're going to continue from the scene that we created in the previous recipe, and we only need to add one thing: a rainmaker object called obj_rain. Seems simple enough, right? Let's take a look at how it can work.

How to do it...

  1. In obj_rain, add a Step event.

  2. Drag a code block to the Actions box and add the following code:

    effect_create_above(ef_rain, 0, 0, 0, c_white);
  3. Place an instance of obj_rain anywhere in the room.

That's it! Once these steps have been completed...