Importing sprite sheets

While all the animations in this book will be using GIF images for the sake of expediency, it would be remiss if we did not cover how to import a sprite sheet. A sprite sheet is generally a PNG file with all the frames of animation of an object, such as a character, placed evenly in a grid. We can then quickly cut out each frame of animation in GameMaker to build the individual sprites we need. Let's try this out!

  1. Let's start by opening a New Project called Chapter_02.
  2. Create a new Sprite and name it spr_PlayerSpriteSheet.
  3. Click on the Edit Sprite button to open the Sprite Editor.
  4. Under File, select Create from Strip, and then open Chapter 2/Sprites/PlayerSpriteSheet.png with nothing selected in the Image Information section. ...

Get HTML5 Game Development with GameMaker now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.