From 60240bb48327a430ccf9dd3454a6ecf146ca72d1 Mon Sep 17 00:00:00 2001 From: Jacob Date: Tue, 26 Mar 2019 14:01:40 +0100 Subject: [PATCH] Add smoe coments --- magazine/static/magazine/sketch.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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);