Skip to content

Instantly share code, notes, and snippets.

@bashbaugh
Last active February 27, 2019 02:07
Show Gist options
  • Select an option

  • Save bashbaugh/9ccf90395f8ce644274cbe9eff3d3806 to your computer and use it in GitHub Desktop.

Select an option

Save bashbaugh/9ccf90395f8ce644274cbe9eff3d3806 to your computer and use it in GitHub Desktop.
function update()
{
let time_right_now = date.getTime()
// If time right now minus start time is less than game time limit:
if (time_right_now - start_time < game_duration)
{
// Compare player coordinates to dot coordinates to see whether the player is above a dot. Increment score if so.
// Check distance from highest dot to top of screen. If greater than dot_distance_apart, create a new dot at top.
}
else // else: game is over.
{
// Set game_over to true.
}
// Clear the canvas and draw the background.
// Draw dots and move them down the screen.
// Ensure that player is within canvas
// Draw player onto screen.
// Draw score onto screen.
// IF game_over:
// Draw game over screen
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment