@Override public void onLivesChanged(int lives) { if (lives - 1 == this.lives) { Assets.playSound(Assets.extraLifeSound); } this.lives = lives; }
@Override public void onRobotDestroyed(Robot robot) { if (lastRobotHitTime != now) { Assets.playSound(Assets.killRobotSound); lastRobotHitTime = now; } }
@Override public void onRobotFired(Robot robot) { if (lastRobotFireTime != now) { Assets.playSound(Assets.robotShotSound); lastRobotFireTime = now; } }
@Override public void onCaptainActivated(float time) { Assets.playSound(Assets.captainEnterRoomSpeech); // We can't do much about any speech going on, but we can make sure nothing else talks over the // top of this // one. scheduleTaunt(); }
@Override public void onPlayerHit() { if (lastPlayerHitTime != now) { canTaunt = false; Assets.playSound(Assets.killPlayerSound); lastPlayerHitTime = now; } }
@Override public void onExitedRoom(float time, int robots) { isChicken = robots > 0; if (isChicken) { Assets.playSound(Assets.exitRoomAsChickenSpeech); } canTaunt = false; }
public void update(float delta) { now += delta; if (canTaunt && now >= nextTauntTime) { Sound[] sounds = isChicken ? Assets.chickenTaunts : Assets.standardTaunts; Assets.playSound(sounds[random(sounds.length - 1)]); scheduleTaunt(); } }
@Override public void onPlayerFired() { Assets.playSound(Assets.playerShotSound); }
@Override public void onEnteredRoom(float time, int robots) { Assets.playSound(Assets.spawnPlayerSound); }
@Override public void onAttained(Achievements achievement) { Assets.playSound(Assets.achievementSound); }