Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
GameMaker Programming By Example

You're reading from   GameMaker Programming By Example Master the development of 2D games by learning to use the powerful GameMaker Language and tools provided by the GameMaker: Studio workspace and engine!

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781785887963
Length 212 pages
Edition 1st Edition
Arrow right icon
Authors (2):
Arrow left icon
Brian Christian Brian Christian
Author Profile Icon Brian Christian
Brian Christian
Steven Isaacs Steven Isaacs
Author Profile Icon Steven Isaacs
Steven Isaacs
Arrow right icon
View More author details
Toc

Chapter 1. Introduction to GameMaker: Studio

In the 15 years of GameMaker experience between us, we have both found it to be one of the best tools for teaching design as well as the introduction to computer science principles. The drag and drop interface lends beautifully to the understanding of computer science concepts related to object-oriented programming including sequencing, loops, conditional statements, variables, among others. Moving from the drag and drop approach to coding in GameMaker Language (GML) is logical and the transition demystifies coding. It is also important to point out the importance of iterative design and debugging that people learning game development with GameMaker will become overly familiar with through the process.

By definition, a game is a special kind of program that is run inside a loop that repeats as long as the user has not decided to close the game program. This loop contains code that creates objects that each have their own loops to control animation, movement, actions, and logic statements based on various aspects of what is occurring in the game. The objects are run until the time they are removed from the program. The main loop also contains logic statements that run code based on different possible user input values. An example of such logic would test if the user has pressed the spacebar, and if so, the game will modify variables of the player object so that it rises, and then falls at a certain point. In order for the player to understand what they have done in their game, the main loop contains code to push graphics to the screen and audio to the speakers, both of which are affected by what different game objects are doing.

There are many different ways to create games. Some people choose to write them in native C++ code without any sort of specialized Integrated Development Environment (IDE). However, GameMaker: Studio is a collection of tools contained in an IDE that make the game creation process much easier, by providing various tools and code functions that are specialized for creating games. For example, there is a visual object editor so that the developer doesn't have to define every single property of objects in code, but rather they can select various boxes that define object properties. Objects control nearly every aspect of a GameMaker game. Rather than using an external spritesheet file containing separate frames of animation, GameMaker contains a sprite editor where each sprite in itself is a special type of object that contains the images. All the developer has to do is to set the sprite of an object to the main sprite, which will then provide access to all of the images inside this sprite. The main game loop is run in rooms, where all of the objects are placed, in turn creating the full game. At compile time, everything produced in the project is converted into C++ code, then compiled, so in the end, the developer has essentially written their game in C++, but by using a much easier method.

We will begin with an overview of the different versions of GameMaker: Studio that are available for download. This will be followed by a guide to the User Interface (UI) of the IDE to orientate you to working in the GameMaker environment. In this simple example, you will learn about creating resources (various kinds of assets) and their purposes, naming conventions, and some drag and drop coding among other skills. The IDE is essentially a collection of integrated editing tools used in a programming environment.

GameMaker: Studio is an application used by newcomers to game design and by experienced developers alike, for both personal and commercial purposes:

  • This contains a very clean interface including a fully functional drag and drop programming interface making it very easy to get started creating games. Experienced GameMaker developers typically choose to create games using the text-based coding functionality of the built-in GML.
  • This also contains many high-level functions and components for a variety of things that developers might need done in their game and for a variety of platforms. Examples include networking, Steamworks™ SDK support, in-app purchases, and more for platforms such as Microsoft Windows™, Apple Mac OS X™, Linux™ in terms of desktop and laptops, and Google Android™, and Apple iOS for mobile. Many more platforms are available for use with GameMaker: Studio.
  • GameMaker: Studio has been used to create many commercial games, a varying selection of which you can view at http://yoyogames.com/showcase.
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime