private void OnPlayerDeath(CharacterController characterController, bool behindScreen) { Screen.soundController.PlaySound("Game/death"); Vector2 pos = characterController.model.position; int playerIndex = characterController.model.playerIndex; int gotKilled = characterController.model.playerIndex; int killer; if (players[gotKilled].GotKilled(out killer)) { //Removes powerup from player powerUps.RemovePowerUp(gotKilled); //Updates killer players[killer].Killed(gotKilled); characterController.Reset(map.CurrentMap.startingPosition[resetPos], behindScreen); if (resetPos == 3) { resetPos = 0; } else { resetPos++; } } else { camera.RemoveCharacterTarget(characterController); RemoveController(characterController); } }
private void OnPlayerDeath(CharacterController characterController, bool behindScreen) { Screen.soundController.PlaySound("Game/death"); Vector2 pos = characterController.model.position; int playerIndex = characterController.model.playerIndex; int gotKilled = characterController.model.playerIndex; int killer; if (players[gotKilled].GotKilled(out killer)) { //Removes powerup from player powerUps.RemovePowerUp(gotKilled); //Updates killer players[killer].Killed(gotKilled); characterController.Reset(map.CurrentMap.startingPosition[resetPos], behindScreen); if (resetPos == 3) resetPos = 0; else resetPos++; } else { camera.RemoveCharacterTarget(characterController); RemoveController(characterController); } }