diff --git a/CM2030 Graphics Programming/Topic 1/1.5.1/sketch.js b/CM2030 Graphics Programming/Topic 1/1.5.1/sketch.js index 0b7f028..f9b9525 100644 --- a/CM2030 Graphics Programming/Topic 1/1.5.1/sketch.js +++ b/CM2030 Graphics Programming/Topic 1/1.5.1/sketch.js @@ -4,22 +4,30 @@ let locY = 200; let w = 200; let h = 100; let myButton = null; +let buttonArray = []; function setup() { createCanvas(900, 600); - myButton = new Button(200, 200, 200, 100); + buttonArray.push(new Button(200, 200, 200, 100)); + buttonArray.push(new Button(300, 300, 200, 100)); } function draw() { background(220); - myButton.draw(); + for(let i=0; i