xxxxxxxxxx
37
x = 375;
y = 250;
vx = 0;
vy = 0;
dt = 0.1;
function draw(){
// Update location
x += vx*dt;
// velocity is zero unless keys are pressed
vx = 0;
// Turn or thrust the ship depending on what key is pressed
if (keyIsDown(LEFT_ARROW)) {
// Do nothing!
}
if (keyIsDown(RIGHT_ARROW)) {
vx = 10;
}
if (keyIsDown(UP_ARROW)) {
// Do nothing!
}
if (keyIsDown(DOWN_ARROW)) {
// Do nothing!
}
// Draw axes and other stuff
display();
drawBlob(x,y,vx,vy);
// Add more graphics here before the end of draw()
} // end draw() DO NOT ADD ANY CODE AFTER THIS LINE!!!