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

Importing and playing background music


Personally, I feel that music affects my enjoyment of a game in a big way. I have my favorite game music such as the level two background music from Super Mario Bros. 3, the Song of Storms from Legend of Zelda: Ocarina of Time, and the entire soundtrack of Capy Games' Superbrothers: Sword & Sworcery. They each bring with them a certain element of nostalgia, as they play an important role in my gaming history. It's tough to say, with certainty, whether my enjoyment of each of these games could have been affected by a change in the music, but I think it could. I'm sure if you think of your favorite moments from your favorite games, you can hear the music in your head. Keeping this in mind (no pun intended), let's learn a little about importing and playing music in GameMaker.

Getting ready

You'll need three things to begin this recipe: a room (of course), an object called obj_musicControl, and a song of your choice. You can use either an .mp3 or a .wav...