pulse.js 282 B

1234567891011121314
  1. var stage = new mtm.Stage('c'),
  2. ball = new Ball(stage.width/2, stage.height/2),
  3. centerScale = 1,
  4. angle = 0,
  5. range = .5,
  6. speed = .1;
  7. stage.shapes.push(ball);
  8. stage.play(function() {
  9. ball.scale = centerScale + Math.sin(angle) * range;
  10. angle += speed;
  11. });