(4) The Player

Creating the Player (Discussion)

So that we can control the initial properties of certain Game Objects when they are first created

We create a temporary layout to store them

This layout is not used in the game as a level

It is just our source of pre-configured game objects.

65 Add a new Layout

Call it Temp

66 Add a new sprite to the Temp layout

Call it Player

Import the animations from the sprite strips:

(Idle, Run, Fall, DoubleJump, Hit, Jump, WallJump)

Rename the animation to Idle

Set all multi-frame animations speed to 20 fps and loop

Leave single-frame animations speed at 5fps and don't loop.

Recommended size for Player is same size as mushroom 

67 Create an Event Sheet for the Player if you have not done so already

Call it evPlayer

Add it to the General folder

68 Open evLevel1 Event Sheet

Include evPlayer if you have not done it previously

Now we can keep all player functions in one place.

69 

Play with the settings of the player controller (yellow box)

Recommended settings are shown LEFT.




70 Move the Player object into the Player folder

Create a new Object Types subfolder

Call it Plugins

Add the Keyboard Object

Player Portrait and Health Bar

71 Download this image and use it as your PlayerPortrait Sprite (Right click and save image as)

<--- image

72 Use these 4 images for your PlayerHearts frames

73 Use this image for your PlayerDeath Sprite

Put it on the Temp Layout

Untick initially visible 

Give it the Platform Behaviour and untick default controls

Add the Rotation Behaviour and use settings as shown

74 Put the 3 new Player Sprites you downloaded in the Player Folder

NOTE: The Player Sprite represents only how the player LOOKS

It is only the players APPEARANCE and ANIMATIONS

The player object which we control will just be the player controller (yellow box).

This is often called the HitBox or HurtBox.


All the code logic will operate on this box.

We will pin the sprites with their animations to this box.

It will appear as if the sprites are being controlled.

75 Set the player controller initially visible to false

76 In the Player Evsheet Link the Player Animator (Player) and the Player Controller (PlayerController)