Basic JS Game - Part 3
In this part, you need to add a player character
- Add a variable for the player (gPlayer) similar to the gMonster - make it move at PLAYER_SPEED and have a different colour to the monster
- Add code for the player to
drawGame
UpdateGame
startTheGame
- Have it constrained to the canvas edges instead of bouncing off (there is a function in utilities.js for this)
- in the UpdateGame function, insert code so that if the player and monster collide the game ends (call endGame()) - there is a collision detection funciton in utilities.js
At this stage the project looks like this.