You are previewing GameMaker Programming By Example.
O'Reilly logo
GameMaker Programming By Example

Book Description

Master the development of 2D games by learning to use the powerful GameMaker Language and tools provided by the GameMaker: Studio workspace and engine!

About This Book

  • Rapidly develop games using the powerful yet easy easy-to to-use GameMaker: Studio engine

  • Comprehensive: This is a comprehensive guide to help you learn and implement GameMaker’s features.

  • Go through step-by-step tutorials to design and develop unique games

  • Who This Book Is For

    If you have at least some basic programming experience of JavaScript or any other C-like languages, then this book will be great for you. No experience beyond that is assumed. If you have no game development experience and are looking for a hobby, are an experienced game developer looking to master some advanced features, or fit anywhere in that spectrum, then you will find GameMaker: Studio and this book to be very useful in helping you create exciting games.

    What You Will Learn

  • Understand the GameMaker: Studio interface and tools to quickly create the various assets used in your games

  • Translate some of the GameMaker: Studio drag and drop functions to the GameMaker language

  • Create games with random elements for exciting gameplay

  • Use the basic GameMaker file I/O and encryption systems

  • Utilize the GameMaker networking functions to create multiplayer games

  • Give AI routines to your enemies to make challenging gameplay

  • Create particle systems to give your game exciting graphics

  • Understand the various debugging techniques available in GameMaker: Studio

  • In Detail

    This book is excellent resource for developers with any level of experience of GameMaker. At the start, we’ll provide an overview of the basic use of GameMaker: Studio, and show you how to set up a basic game where you handle input and collisions in a top-down perspective game.

    We continue on to showcase its more advanced features via six different example projects. The first example game demonstrates platforming with file I/O, followed by animation, views, and multiplayer networking. The next game illustrates AI and particle systems, while the final one will get you started with the built-in Box2D physics engine. By the end of this book, you have mastered lots of powerful techniques that can be utilized in various 2D games.

    Style and approach

    A This step-by-step guide that follows and with details ons different topics throughout the creation of various examples.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

    Table of Contents

    1. GameMaker Programming By Example
      1. Table of Contents
      2. GameMaker Programming By Example
      3. Credits
      4. About the Authors
      5. About the Reviewer
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Downloading the color images of this book
          3. Errata
          4. Piracy
          5. Questions
      8. 1. Introduction to GameMaker: Studio
        1. Choosing your version
        2. The GameMaker: Studio interface
          1. GameMaker: Studio documentation
        3. An example project
          1. Naming convention – resource prefixes
          2. Drawing the sprite
          3. Creating an object
          4. Coordinate planes in GameMaker
          5. Creating a room
          6. Testing your game
        4. Summary
          1. Review questions
          2. Quick drills
      9. 2. Your First Game – Escape the Dungeon
        1. Creating your Escape the Dungeon game
          1. The playable character
            1. The sprite
            2. The object
          2. Walls
          3. Enemies
            1. Making your enemies move
            2. Damaging the player
          4. Making the player and enemies shoot
            1. Making the player shoot
            2. Making the enemies shoot
          5. More resources
            1. Backgrounds
            2. Sounds
          6. Keys and locks and advancing to the next room
        2. Summary
          1. Review questions
          2. Quick drills
      10. 3. Introducing the GameMaker Language
        1. Remaking Escape the Dungeon in the GML
          1. Remaking the sprites
          2. Remaking the player object
            1. Understanding the four events
            2. Starting to code your player object
              1. Making the player move
              2. Changing the subimage
              3. Collisions
          3. Coding the enemies
            1. Random seeds
          4. Health and lives system
            1. Displaying health and lives
            2. Invincibility
          5. Shooting
          6. Sounds
          7. Keys and locks
          8. Scripts
        2. Summary
          1. Review questions
          2. Quick drills
      11. 4. Fun with Infinity and Gravity – An Endless Platformer
        1. Creating an endless platformer
          1. Bouncing and movement
          2. Death and enemies
          3. Random spawning
            1. 2D arrays
          4. Menus and textboxes
            1. Menus
            2. Textboxes
        2. Summary
          1. Review questions
          2. Quick drills
      12. 5. Saving and Loading Data
        1. Putting in a scoring system
          1. Saving and loading a highscore
            1. INI file encryption
        2. Customizable controls
          1. Saving control configurations
        3. Summary
          1. Review questions
          2. Quick drills
      13. 6. A Multiplayer Sidescrolling Platformer
        1. Sprite animation
          1. Spritesheet importing
          2. Programming the movement
        2. Making your scrolling platformer scroll
        3. Client/server multiplayer networking
          1. Networking terminology
          2. Printing the server's IP address and port on a screen
          3. Creating the actual server
            1. Our Asynchronous Networking event
              1. Connection
              2. Disconnection
              3. Handling data
                1. Our data handling script
          4. The client in your client/server system
        4. Integrating Xbox gamepad support
          1. Legacy gamepad support
          2. Modern gamepad support
        5. Summary
          1. Review questions
          2. Quick drills
      14. 7. Programming a Scrolling Shooter
        1. Creating the main ship
        2. Creating the enemies
          1. Parenting in objects
          2. Random enemy spawning
        3. Programming a Boss AI
        4. Particles
        5. Summary
          1. Review questions
          2. Quick drills
      15. 8. Introducing the GameMaker: Studio Physics Engine
        1. A physics game
        2. The physics engine in a regular game
        3. Summary
          1. Review questions
          2. Quick drills
      16. 9. Wrapping Up
        1. Debugging
          1. Compile-time errors
          2. Runtime errors
          3. The GameMaker: Studio debugger
          4. Debugging functions
        2. Helpful information on GameMaker
          1. Quirks of the GameMaker Language
          2. Unexplained resources
          3. Export modules
        3. Summary
          1. Review questions
          2. Quick drills
      17. Index