Please enable JavaScript.
Coggle requires JavaScript to display documents.
Version 4 of Meteor Dodge (Events (IF lives = 0 (Display “Game Over…
Version 4 of Meteor Dodge
Setup
Create Stars class
Create Planet class
Create Canvas
Create Meteors class
Objects
Meteors
Diameter
Colour
Movement speed (right → left)
Stars
Diameter
Colour
Planet
Colour
Movement speed (left/right/up/down)
Diameter
Events
IF meteor hits planet
Delete meteor
Remove 1 life
IF meteor hits left side of the screen
Delete meteor
IF lives = 0
Display “Game Over
Username
!, You reached level
levelNum
”
Run levelhighscore function
Level = 0
Remove all objects
Display main menu GUI
IF left arrow is pressed
Move planet left
IF right arrow is pressed
Move planet right
IF up arrow is pressed
Move planet up
IF down arrow is pressed
Move planet down
IF pause button pressed
Call pause function
GUI
Main Menu
Click to start
Instructions
Game Active
Pause button
Levels
Lives
Functions
HighScore
If Level> Highscore
HighscoreLvl = Level
Move Planet
Left arrow key pressed
Planet moves left
Right arrow key pressed
Planet moves right
Up arrow key pressed
Planet moves up
Down arrow key pressed
Planet moves down
Move Meteors
IF the level started
Draw num of meteors
Move towards left with random velocities
Levels
Each time the next level starts
Lives = 3
Add the number of meteors by 5
Pause
IF pressed
Display “
Username
Paused the Game!” + “You are on level
levelNum
”
Meteors don’t move
Planet can’t move
Username input
Textbox input
If username is validated
Accept username
Else
Display “That name isn’t valid”