Ejemplo n.º 1
0
  public void spawn(LevelScene levelScene, int x, int y, int dir) {
    if (isDead) return;

    if (type == Sprite.KIND_ENEMY_FLOWER) {
      sprite = new FlowerEnemy(levelScene, x * 16 + 15, y * 16 + 24, x, y);
    } else if (type == Sprite.KIND_WAVE_GOOMBA) {
      sprite = new WaveGoomba(levelScene, x * 16 + 8, y * 16 + 15 - 3 * 16, dir, x, y);
    } else if (type == Sprite.KIND_PRINCESS) {
      sprite = new Princess(levelScene, x * 16 - 16, y * 16 - 15, x, y, levelScene);
    } else {
      //            sprite = new Enemy(levelScene, x*16+8, y*16+15, dir, type, winged);
      sprite = new Enemy(levelScene, x * 16 + 8, y * 16 + 15, dir, type, winged, x, y);
    }
    sprite.spriteTemplate = this;
    levelScene.addSprite(sprite);
  }