diff --git a/magazine/static/magazine/sketch.js b/magazine/static/magazine/sketch.js index ebb1597..6f66af1 100644 --- a/magazine/static/magazine/sketch.js +++ b/magazine/static/magazine/sketch.js @@ -4,17 +4,20 @@ let packageClaim; let going = false; let forklift; +// This runs once at start function setup() { createCanvas(500, 500).parent('canvas'); + frameRate(30); createMagazineLayout(); select('#button').mousePressed(deliver); - + // Create a forklift instance forklift = new Forklift(sections['START'].x, sections['START'].y); } +// This runs every frame function draw() { background(64); drawMagazine(); @@ -32,6 +35,7 @@ function drawMagazine() { noFill(); stroke(220); strokeWeight(10); + // Draw all the roads in the magazine for (let road of roads) { line( sections[road[0]].x, @@ -42,6 +46,7 @@ function drawMagazine() { } noStroke(); textAlign(CENTER, CENTER); + // Draw all sections in the magazine for (let section of Object.keys(sections)) { if (section === 'START') { fill(80);