Book Image

GameMaker Game Programming with GML

By : Matthew DeLucas
Book Image

GameMaker Game Programming with GML

By: Matthew DeLucas

Overview of this book

<p>GameMaker: Studio is a popular game engine used to publish games to a variety of platforms. Although GameMaker: Studio's drag-and-drop functionality makes creating games simple and fast, utilizing scripts can really help organize and speed up GameMaker's workflow exponentially.</p> <p>This hands-on guide will help you build a strong foundation in programming in GameMaker Language by taking you through several example games. Knowledge gained by the end of the book can be applied so you can build your own line of exciting games.</p>
Table of Contents (17 chapters)
GameMaker Game Programming with GML
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Checking pieces


The board is now built with a random configuration; however, there may already be sets of matching pieces. Of course, just because a player can see a set, does not mean the game can.

To find matching sets of three or more pieces on the game board, the game will start at the upper-left corner of the screen. It will then check the pieces below and to the right of this initial piece. If there are three or more matching pieces in the same direction, they will be re-randomized. The board will then continue to be checked. If there are sets of matching pieces, the entire process is repeated. This is known as a recursive process due to its repetitive nature. It will continue to be executed until its goal of starting the player out with a fresh board, where there are no adjacent sets of three or more matching pieces, is achieved.

scr_get_puzzle_piece

The first thing the game should be able to do is return any piece from the board; however, due to the recursive nature of the function...