Skip to content

Instantly share code, notes, and snippets.

@wallyatkins
Created March 10, 2020 17:38
Show Gist options
  • Select an option

  • Save wallyatkins/12bebad021500af786a49f750997b06f to your computer and use it in GitHub Desktop.

Select an option

Save wallyatkins/12bebad021500af786a49f750997b06f to your computer and use it in GitHub Desktop.
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