acceleration1.js 170 B

123456789101112
  1. var stage = new mtm.Stage('c'),
  2. ball = new Ball(50, 100),
  3. vx = 0,
  4. ax = .2;
  5. stage.shapes.push(ball);
  6. stage.play(function() {
  7. vx += ax;
  8. ball.x += vx;
  9. });