Last active
February 27, 2019 02:07
-
-
Save bashbaugh/9ccf90395f8ce644274cbe9eff3d3806 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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