Skip to content

Instantly share code, notes, and snippets.

@bashbaugh
Created February 26, 2019 01:45
Show Gist options
  • Save bashbaugh/84c55210b16b144b41b7093bb9c116ca to your computer and use it in GitHub Desktop.
Save bashbaugh/84c55210b16b144b41b7093bb9c116ca to your computer and use it in GitHub Desktop.
// there is one number in dots_x for each dot, so dots_x.length is equal to the number of dots.
// For every dot:
for (i = 0; i < dots_x.length; i++)
{
// if dot's x is same as player's x and dot's y is same as player's y
if (dots_x[i] == player_x && dots_y[i] == player_y)
{
score += 2; // Increment score by two.
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment