INNER CODE UNIT · JavaScript

s

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

      var s = speed / M.length(iball.velocity[0], iball.velocity[1]);
      iball.velocity[0] *= s;
      iball.velocity[1] *= s;
      iball.angularVelocity = iball.angle = 0;

      if (ibottom) {
        world.removeBody(iball);
        !anyBall() && die();

      } else if (ibrick) {
        world.removeBody(ibrick);
        score++;
        sound.brick.play();
        updateStatus();
        if (!anyBricks()) {
          levelup();
        } else if (Math.random() > 0.8) {
          var drop = newDrop(Math.random() > 0.4 ? "+" : "-");

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…