Created
March 10, 2020 17:38
-
-
Save wallyatkins/12bebad021500af786a49f750997b06f 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 setup() { | |
| createCanvas(windowWidth, windowHeight); | |
| background(255); | |
| var DOTS_IN_ROWS = 10; | |
| var DOTS_IN_COLS = 10; | |
| var GAME_SIZE = windowHeight; | |
| // check for phones (tall screens) | |
| if (windowHeight > windowWidth) { | |
| GAME_SIZE = windowWidth; | |
| } | |
| for (var i = 0; i < DOTS_IN_ROWS; i++) { | |
| for (var j = 0; j < DOTS_IN_COLS; j++) { | |
| fill(random(0, 255), random(0,255), random(0, 255)); | |
| ellipse( | |
| GAME_SIZE / DOTS_IN_ROWS * i + GAME_SIZE / 2, // x coordinate | |
| GAME_SIZE / DOTS_IN_COLS * j + GAME_SIZE / DOTS_IN_COLS / 2, // y coordinate | |
| 10, | |
| 10 | |
| ); | |
| } | |
| } | |
| } | |
| function draw() { | |
| // fill(0); | |
| // draws circles | |
| // ellipse(mouseX, mouseY, 20, 20); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment