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:
- Create a new Sprite,
spr_Player_Idle
, and loadChapter 5/Sprites/Player_Idle.gif
with Remove Background checked. - 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. - Click on Modify Mask to open the Mask Properties ...
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.