The Player
The player
configuration allows you to define the initial characteristics of the playable character in your game.
- The
sprite
property defines the visual appearance of theplayer
. - The
position
property sets the initial position of theplayer
in the game world, expressed as an array containing the x and y coordinates.
Note
Coordinates are measured from top to bottom and left to right.
For example:
[0, 0]
places the player in the top-left corner.[3, 5]
places the player in the third column from the left and the fifth row from the top.
Dynamically Modifying the player
State
To modify or check the state of the player
, you can use the game
object returned by the createGame
function.