O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting Started with Game Maker

Book Description

Getting Started with Game Maker shows aspiring game developers how to create their very own, professional-quality computer games, no programming knowledge required. Using Game Maker's simple, drag-and-drop environment and following along with the step-by-step instructions, you'll learn how to create arcade-style 2D and 3D games complete with graphics, sound effects, and music. Game Maker provides everything you need to create, test, debug, and run your games in a Windows environment. Even if you're brand new to game development, you'll be able to make a working game that you can play and share others. And not having to worry about the programming the game allows you to focus on the design and how to make the game more fun and challenging. Along the way you'll learn the basic principles of game development. And if you want to create more complex games you can take advantage of Game Maker's built-in Game maker Language that allows you to develop highly advanced games and applications. So let's get started!

Table of Contents

  1. Copyright
    1. Dedication
  2. Acknowledgments
  3. About the Author
  4. Introduction
    1. Why Game Maker?
    2. Who Should Read This Book?
    3. What You Need to Begin
    4. Conventions Used in This Book
  5. I. Game Maker Basics
    1. 1. Introducing Game Maker
      1. Computer Game Development Is Serious Business
      2. Getting to Know Game Maker
        1. Game Maker Uncovered
          1. Game Maker’s Integrated Development Environment
          2. Game Maker’s Game Engine
          3. DirectX
          4. The Game Maker Language (GML)
        2. Game Maker’s Unique Drag-and-Drop Approach
        3. Two-Dimensional Versus Three-Dimensional Game Development
      3. Getting Started with Game Maker
        1. Downloading Game Maker
        2. Installing Game Maker
        3. Simple Versus Advanced Mode
        4. Purchasing Game Maker Pro
      4. Creating Games with Game Maker
      5. Joining Game Maker’s Global Community
        1. Sharing Your Games with the World
        2. Signing Up with the Game Maker Website
      6. Loading and Running a Sample Game
      7. Summary
    2. 2. Getting Comfortable with the Game Maker IDE
      1. Exploring the Game Maker IDE
        1. Access Menu Commands
        2. Working with Game Maker’s Toolbar
        3. Keeping an Eye on Project Resources
        4. The Main Work Area
      2. Working with Project Resources
        1. Creating Sprites
        2. Creating Sounds
        3. Creating Paths
        4. Creating Fonts
        5. Creating Timelines
        6. Creating Objects
        7. Creating Rooms
        8. Creating Backgrounds
        9. Creating Scripts
      3. Outlining Game Information
      4. Specifying Global Game Settings
      5. Enhancing Game Maker’s Capabilities
      6. Accessing Game Maker’s Help Files
      7. Configuring Game Maker Preferences
      8. Summary
    3. 3. A Big Picture Overview of How Things Work
      1. Big Picture Time
      2. Understanding Objects
        1. Setting Object Properties
        2. Configuring Objects to React to Events
        3. Adding Actions to Objects
          1. Controlling Object Movement
          2. Actions that Affect Objects, Sprites, Sounds, and Rooms
          3. Controlling Game Timing, Restarts, and Resources
          4. Adding Actions that Control Object Execution
          5. Keeping Score and Managing Player Lives and Health
          6. Creating Special Effects and Playing Music CDs
          7. Drawing Shapes, Sprites, and Text
      3. Putting Everything Together
        1. Step 1—Defining Sprites Used by the Demo
        2. Step 2—Defining the Game’s Sound Effect
        3. Step 3—Configuring the Game’s Background
        4. Step 4—Defining Ball and Wall Objects
        5. Step 5—Adding a Room to the Game and Configuring Room Properties
        6. Step 6—Developing Program Logic for the Ball Object
        7. Running the Demo Program
      4. Summary
  6. II. Learning How to Create Game Maker Games
    1. 4. Super Pong—Your First Game
      1. Essential Game Resources
        1. Representing Objects with Sprites
          1. Loading an External Sprite File
          2. Creating and Modifying Graphic Images
          3. Creating Sprites from Strips
          4. Editing Graphic Images
          5. Setting Sprite Properties
        2. Getting Creative with Sound
        3. Setting the Mood with Backgrounds
        4. Creating Levels and Game Worlds Using Rooms
          1. Adding Objects to Rooms
          2. Configuring Room Settings
          3. Working with Tile Sets
          4. Adding a Background
          5. Specifying Different Views
      2. Creating the Super Pong Game
        1. Step 1—Creating the Game’s Sprites
        2. Step 2—Creating Sounds
        3. Step 3—Adding a Background
        4. Step 4—Adding a Font
        5. Step 5—Defining the Game’s Objects
          1. Creating the ball object
          2. Creating the right paddle object
          3. Creating the left paddle object
          4. Creating the wall object
          5. Creating the right goal object
          6. Creating the left goal object
          7. Creating the controller object
        6. Step 6—Developing Object Program Logic
          1. Adding programming logic to the obj_ball object
          2. Adding programming logic to the obj_rightpaddle object
          3. Adding programming logic to the obj_leftpaddle object
          4. Adding programming logic to the obj_controller object
        7. Step 7—Creating a Room
      3. Summary
    2. 5. Skybuster—A Breakout Game
      1. Focusing on Good Game Design
      2. Designing Your Game
        1. Take Care When Designing Levels
        2. Creating Challenging Games
        3. Creating Clear Goals and Objectives
        4. Make Sure Player Choices Count
        5. Rewarding the Player for Deeds Well Done
        6. Always Include the Expected
      3. It’s Time to Break Some Blocks
        1. Step 1—Defining the Game’s Sprites
        2. Step 2—Creating Sounds
        3. Step 3—Setting the Mood with a Good Background
        4. Step 4—Creating Rooms to Play In
        5. Step 5—Defining and Programming Objects
          1. Creating the ball object
          2. Creating the paddle object
          3. Creating the wall object
          4. Creating the red brick object
          5. Creating the green brick object
          6. Creating the controller object
          7. Creating the obj_miss object
      4. Summary
    3. 6. Tank Battle—A Two-Player Competitive Game
      1. Adding a Few Bells and Whistles to Your Games
        1. Disabling the Escape Key
        2. Adding Game Cheats
        3. Displaying Your Own Splash Screen
        4. Modifying Game Maker’s Progress Bar
        5. Running Games in Full-Screen Mode
        6. Letting Players Save Game State
        7. Displaying Game Information
        8. Creating Standalone Games
        9. Adding Custom Icons to Your Games
      2. Creating the Tank Battle Game
        1. Step 1—Creating the Game’s Sprites
        2. Step 2—Adding Sound
        3. Step 4—Adding a Font
        4. Step 5—Creating and Programming Objects
          1. Programming the blue tank object
          2. Programming the red tank object
          3. Programming the blue bullet object
          4. Programming the red bullet object
          5. Programming the controller object
        5. Step 6—Creating Different Levels in Which to Play
        6. Wrapping Things Up
          1. Adding Game Information
          2. Tank Battle
          3. Configuring Global Game Settings
      3. Summary
    4. 7. Alien Attack—A Cooperative Two-Player Game
      1. Developing Front Ends and Back Ends
      2. Adding a Front End to Your Games
        1. Developing Background and Graphic Files
        2. Creating Front-End Button Controls
        3. Turning a Room into a Front End
        4. Adding Program Logic to the Front End’s Controls
          1. Programming the Start Button
          2. Programming the Help Button
          3. Programming the Exit Button
      3. Adding a Back End to Your Games
        1. Creating Graphics and Associated Objects
        2. Adding the Requisite Programming Logic
      4. Creating the Alien Attack Game
        1. Step 1—Adding the Game’s Sprites
          1. Creating the Sprite for Player 1’s Jet
          2. Creating the Sprite for Player 2’s Jet
          3. Creating the Red Alien Ship
          4. Creating the Blue Alien Ship
          5. Creating the Green Alien Ship
          6. Creating a Bullet
          7. Creating an Animated Explosion
          8. Creating the Control Panel
        2. Step 2—Creating the Game’s Sounds
        3. Step 3—Adding a Background to the Game
        4. Step 4—Creating a New Font
        5. Step 5—Creating the Game’s Objects
        6. Step 6—Creating the Game’s Rooms
          1. Adding a Front-End Room
          2. Creating a Room in Which to Play
          3. Adding a Back-End Roo
        7. Step 7—Developing Object Programming Logic
          1. Creating a Parent Object for the Jets
          2. Programming Player 1’s Jet
          3. Programming Player 2’s Jet
          4. Programming the Red Alien Ship
          5. Programming the Blue Alien Ship
          6. Programming the Green Alien Ship
          7. Programming the Jet’s Bullet Object
          8. Programming the Alien Ship’s Bullet Object
          9. Programming an Explosion Object
          10. Programming the Special Controller Object
      5. Summary
  7. III. Enhancing Your Games Through Programming
    1. 8. Enhancing Games with GML
      1. Publishing Your Games
        1. Registering with YoYo Games
        2. Publishing Your Games
      2. Introducing the Game Maker Language
      3. Working with Game Maker’s Scripts Menu
      4. Getting Comfortable with the Code Editor
      5. Creating Game Maker Scripts
      6. Integrating GML into Your Games
        1. Creating and Executing Scripts
        2. Adding GML Code to Events
        3. Executing GML Code to Rooms
        4. Adding GML Expressions to Actions
      7. Configuring Game Maker’s Code Editor
        1. Specifying Code Editor Operations
        2. Modifying Code Statement Color-Coding
      8. Summary
    2. 9. GML Scripting—Part 1
      1. Working with Game Data
        1. Embedding Data within Code Statements
        2. Working with Numbers and Strings
      2. Storing Data in Variables
        1. Creating Variables
        2. Managing Variable Scope
          1. Defining Instance Variables
          2. Defining Global Variables
          3. Defining Local Variables
        3. Game Maker’s Special Variables
      3. Working with Data That Does Not Change
      4. Managing Collections of Data
        1. Creating Arrays
        2. Populating Arrays with Data
        3. Retrieving Data from Arrays
      5. Evaluating Options Using Conditional Logic
        1. Introducing the if Statement
          1. if Statement Syntax
          2. Single Line if Statements
          3. if Statement Code Blocks
          4. Setting Up Alternative Courses of Actions
          5. Nesting if Statements within One Another
        2. Comparing One Value Against a Series of Matching Values
      6. Comparing Values Using Relational Operators
      7. Crunching Numbers
      8. Commenting GML Code
      9. Summary
    3. 10. GML Scripting—Part 2
      1. Taking Advantage of the Power of Loops
        1. Setting Up a do ... until Loop
        2. Working with the repeat Loop
        3. Processing Data with the for Loop
        4. Working with while Loops
      2. Altering Loop Execution
        1. Breaking Out of Loops Early
        2. Skipping a Single Iteration
        3. Exiting Loops and Scripts
      3. Using Scripts as Functions
        1. Passing Arguments to Scripts for Processing
        2. Processing Argument Input
        3. Returning a Result from a Script
        4. Retrieving Data Returned by Scripts
      4. Terminating Script Execution
      5. Building a Script Library
      6. Summary
    4. 11. Arachnid Attack!
      1. Troubleshooting Problems with Your Games
      2. Identifying IDE Errors
      3. Dealing with Different Types of Errors
        1. Avoiding Syntax Errors
        2. Preventing Logical Errors
        3. Coping with Runtime Errors
      4. Monitoring Game Execution
        1. Watching Expressions
        2. Monitoring Object Instance and Variable Values
        3. Executing Code Statements
      5. Creating Arachnid Attack!
        1. Step 1—Creating the Game’s Sprites
        2. Step 2—Add the Game’s Sounds
        3. Step 3—Creating a New Font
        4. Step 4—Creating the Game’s Objects
        5. Step 5—Creating the Game’s Rooms
          1. Adding a Room for the Game’s Front End
          2. Adding a Room in which to Play the Game
        6. Step 6—Developing Object Programming Logic
          1. Creating the Game’s GML Scripts
          2. Assembling the Rest of the Game’s Programming Logic
          3. Adding Actions to the obj_bug_parent Object
          4. Adding Actions to the obj_beetle Object
          5. Adding Actions to the obj_player Object
          6. Adding Actions to the obj_player_bullet Object
          7. Adding Actions to the obj_invader_bullet Object
          8. Adding Actions to the obj_controller Object
          9. Adding Actions to the obj_parent_block Object
          10. Adding Actions to the obj_wasp Object
          11. Adding Actions to the obj_start Object
          12. Adding Actions to the obj_scores Object
          13. Adding Actions to the obj_help Object
          14. Adding Actions to the obj_quit Object
        7. Step 7—Adding Finishing Touches
          1. Welcome to Arachnid Attack!
      6. Summary
  8. A. Guide to Bonus Material on the Companion Website
    1. Using the Book’s Source Code
    2. Additional Material
  9. B. What’s Next?
    1. Locating Game Maker Resources Online
      1. The YoYo Games Website
      2. The Game Maker Forums
      3. Gamer Maker’s Wikipedia Page
      4. Game Maker Technology Magazine
      5. The Gamer Maker Language Wikipedia Page
      6. Margaret Meijers Game Maker Site
      7. Finding Inspiration on YouTube
      8. Free Game Maker Tutorials & Game Maker Help Wiki
    2. Recommended Reading
  10. C. Glossary