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 editor and select Bounding Box | Manual. Set the values to Left:
16
, Right:48
, Top:8
, and Bottom:63
.Repeat this process, including the same Origin and Mask Properties for the following sprites:
spr_Player_IdleUp
spr_Player_IdleDown
spr_Player_Run
spr_Player_RunUp...