// Cloned by OmO on 15 Oct 2020 from World "One Cube World (P5)" by Starter user
// Please leave this clone trail here.
const objectSize = 20; // size of object
const anglechange = 0.01; // how much the rotate angle changes each step
var angle = 0; // rotate angle starts at 0
var boardSize = 20;
function setup() // "setup" is called once at start of run
{
createCanvas ( ABWorld.fullwidth(), ABWorld.fullheight(), WEBGL );
}
function draw() // "draw" is called every timestep during run
{
background("lightblue"); // background color
fill("navy");
drawBoard();
}
function drawBoard() {
var x = boardSize*(boardSize/2)
var y = objectSize-(boardSize*20/2)
for(var i = 1; i<boardSize*4-4 ;i++) {
if(i < 21){
y = objectSize*i-(boardSize*20/2)
}else if(i > 20 && i < 40 ) {
x = boardSize*(boardSize/2) - (objectSize * (i - 20))
}else if(i > 39 && i < 60) {
y = objectSize*(i-39)-(boardSize*20/2)
}else {
x = boardSize*(boardSize/2) + (objectSize * (i-30))
}
push()
console.log("hi")
translate(x, y);
box(objectSize);
pop()
}
}