Ejemplo n.º 1
0
  public void bumpInto(int x, int y) {
    byte block = level.getBlock(x, y);
    if (((Level.TILE_BEHAVIORS[block & 0xff]) & Level.BIT_PICKUPABLE) > 0) {
      Mario.getCoin();
      sound.play(
          Art.samples[Art.SAMPLE_GET_COIN], new FixedSoundSource(x * 16 + 8, y * 16 + 8), 1, 1, 1);
      level.setBlock(x, y, (byte) 0);
      addSprite(new CoinAnim(x, y + 1));

      // TODO no idea when this happens... maybe remove coin count
      if (recorder != null) recorder.recordCoin();
    }

    for (Sprite sprite : sprites) {
      sprite.bumpCheck(x, y);
    }
  }