Created
February 26, 2019 02:11
-
-
Save bashbaugh/5f2d93d8ad5edb457a39e894f880ba5a 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
// Clear the canvas and draw background: | |
draw_background(); | |
// 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++) | |
{ | |
// Move dot down canvas a little: | |
dots_y[i] += dot_pixels_per_frame; | |
canvas.beginPath(); // Start drawing | |
canvas.arc(dots_x[i], dots_y[i], dot_radius, 0, 2*Math.PI); // Draw 360 degree arc (full circle) | |
canvas.fillStyle = dots_color[i]; // Set color | |
canvas.fill(); // Fill in circle | |
canvas.closePath(); // End drawing | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment