circle.js 309 B

123456789101112131415
  1. var stage = new mtm.Stage('c');
  2. ball = new Ball();
  3. centerX = 200, centerY = 200,
  4. angle = 0,
  5. radius = 50,
  6. speed = .1;
  7. stage.shapes.push(ball);
  8. stage.play(function() {
  9. ball.x = centerX + Math.sin(angle) * radius;
  10. ball.y = centerY + Math.cos(angle) * radius;
  11. angle += speed;
  12. });