"Brexit" - it took 4.5 years but unfortunately here we are. The aim of the game is to collect as many "goods" as possible, to give you enough points to get into Europe. The player needs to avoid our different EU politicians or we will be kicked back to 'Old Blighty' by border control.
The player can move from left to right on the screen with the keyboard. They have to collect goods to gain points whilst avoiding our politicians. Each good is worth 5 points and the game is won when you reach 100 points. The game is over when the player collides 3 times with a politician.
- index.html
- styles.css
- main.js
- game.js
- player.js
- enemy.js
- goods.js
- buildDom()
- createSplashScreen/removeSplashScreen
- create gameScreen/removeGameScreen
- create gameOverScreen/removeGameOverScreen
- create winScreen/remove winScreen
- startGame/endGame
class Game {
canvas;
ctx;
player;
enemies;
goods;
gameIsOver;
gameScreen;
gamePoints;
}- start
- startLoop
- handleCollisionEnemy
- handleCollisionGoods
- gameOver/gameWon
- gameStats
class Player {
canvas
ctx
x.position
y.position
size
direction
lives
image
speed
}- draw
- update
- setDirection
- handleScreenCollision
- didCollide
- removeLives
class Enemy {
canvas
ctx
x.position
y.position
size
speed
image
}- draw
- update
class Goods {
canvas
ctx
x.position
y.position
size
speed
image
}- draw
- update
-
splashScreen
- Start the game - shows game rules and game title
- When Start button is clicked, it goes to game screen
-
gameScreen
- game is running whilst lives (border control) > 0
- goes to gameOverScreen if lives are === 0
- goes to winScreen if points are === 100
-
gameOverScreen
- shows a losing message, image and a Try Again button
- goes back to splashScreen when Try Again is clicked
-
winScreen
- shows a winning message, image, number of lives left and Restart button
- goes back to splashScreen when Restart button is clicked
- Setup git and gitHub
- Create and connect src files: main.js, game.js, player.js, enemy.js
- BuildDOM in the main.js
- Outline 4 screen states in the main.js & set game state
- Create the screen transitions in the main.js
- Create Game class & add methods
- Create game loop in game.js
- Create player class in player.js
- Move player in game.js
- Create enemy class in enemy.js
- Handle collisions between player & one enemy in game.js
- Move enemy in game.js
- Multiple enemies
- Deduct "lives" from border control
- Create goods class - goods.js
- Handle collision between player & goods
- Move goods (enemy logic) in game.js
- Increment points in scoreboard if "goods" collected
- Add images, audio, CSS etc.
- Time limit (give the player 45 seconds to get 100points)
- Points deduction -- add new enemy (Boris Johnson) - player points are deducted by 10 if you hit him
- Player shooting ability - able to take out politicians
- Sprites