INNER CODE UNIT · JavaScript

a

city41/breakouts · breakouts/stagejs/app.js:352

      var a = Math.PI * M.random(-0.2, 0.2);
      ballBody.velocity = [ speed * Math.sin(a), speed * Math.cos(a) ];
      ballBody.position = [ 0, -0.5 ];
      world.addBody(ballBody);
      sound.recover.play();
    }, P2_DEBUG ? 0 : 3000);
  }

  ui.p2 = new Stage.P2(world, {
    lineWidth : 0.01,
    lineColor : "#888",
    ratio : 256,
    debug : P2_DEBUG
  }).appendTo(stage).on(Stage.Mouse.MOVE, function(point) {
    paddle.position[0] = Math.max(-0.85, Math.min(0.85, point.x));
  }).attr('spy', true).pin("scale", 160);

  ui.tri = Stage.image("tri").prependTo(ui.p2).pin("align", 0.5)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…