Building the player

The player character we are building is the most complex object we have created yet. Not only will the player run and jump, the controls themselves will be slightly different depending on whether the player is on the ground or in the air. The player will need to know what direction they are facing, what animation to be playing, whether they can shoot their weapon, and at what angle. Let's construct this, starting with importing all the sprites:

  1. Create a new Sprite, spr_Player_Idle, and load Chapter 5/Sprites/Player_Idle.gif with Remove Background checked.
  2. Set the Origin to X: 32 Y: 63 so that it rests in the center horizontally and rests on the bottom of the sprite vertically.
  3. Click on Modify Mask to open the Mask Properties ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.