xxxxxxxxxx
39
//the whole point is to eventually draw but be able to undo
//put coordinates in array and draw each line with a for loop
// and delete lines by deleting the last thing in the array
let lines = []
let v1;
let amount = 1
let line;
function lineObj () {
this.show = function(num) {
line(lines[num.x],lines[num.y],lines[num.x+1])
}
}
function setup() {
createCanvas(400, 400);
v1 = createVector(null,null)
v1.x = 150
v1.y = 200
lines.push(v1)
lines.push(v1)
console.log(lines)
line = new lineObj()
lines.push(line)
//lines[0].show()
getArray(lines)
console.log(lines[2].show)
// for(i=0;i<amount;i++){
// line.show(i)
// }
}
function draw() {
background(220);
}