Add smoe coments

This commit is contained in:
Jacob 2019-03-26 14:01:40 +01:00
parent 0281d19f10
commit 60240bb483

View File

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