xxxxxxxxxx
37
// The Nature of Code
// Daniel Shiffman
// http://natureofcode.com
let mover;
function setup() {
createCanvas(640,360);
mover = new Mover();
}
function draw() {
background(200,150,190);
// mover.update();
// mover.checkEdges();
// mover.display();
function keyIsPressed(){
if(keyCode === UP_ARROW) {
mover.acceleration.y+=0.001;
}
else if (keyCode === DOWN_ARROW)
{ mover.acceleration.y-=0.001;
}else if()
mover.velocity.limit(0,0);
mover.acceleration.limit(0,0);
}
mover.update();
mover.checkEdges();
mover.display();
}