void OnTurnEnded(ShootRacePlayer player) { GameManager.instance.Camera().Reset(); GameManager.instance.GUIManager().ResetShootBarSlider(); GameManager.instance.Backboard().DeactivateBonus(); StartNewTurn(player); }
void StartNewTurn(ShootRacePlayer player) { if (!m_gameTimeElapsed) { GameManager.instance.InputManager().SetEnable(true); if (GameUtils.CalculateIfBackboardBlink()) //backboard bonus can become active every start of every players (maybe % in static conf should be low) { GameManager.instance.Backboard().ActivateBonus(); } player.StartTurn(); } }
void Init() { m_Player = new ShootRacePlayer(GameManager.instance.Player().gameObject, GameManager.instance.PlayerBall().gameObject); m_Player.m_onTurnStarted += OnNewTurnStarted; m_Player.m_onTurnEnded += OnTurnEnded; m_Player.m_onScored += OnScored; m_Player.m_onFireballScoreUpdate += OnFireballScoreUpdated; m_Player.m_onFireballActivated += OnFireballActivated; m_Player.m_onFireballActivated += OnFireballDeactivated; m_Player.m_onFireballTimeChange += OnFireballCountdownChanged; m_PlayersInGame.Add(m_Player); m_Opponent = new ShootRacePlayer(GameManager.instance.Opponent().gameObject, GameManager.instance.OpponentBall().gameObject, true); m_Opponent.m_onTurnEnded += StartNewTurn; m_Opponent.m_onScored += OnScored; m_PlayersInGame.Add(m_Opponent); m_gameRemainingTimeCountdown = new TimeCountdown(); m_gameRemainingTimeCountdown.onTimeChanged += OnGameRemainingTimeChanged; m_gameRemainingTimeCountdown.onTimeElapsed += EndGame; }
public BasicPlayerAI(ShootRacePlayer player) //Better if create and use interface for players, not ShootRace { Assert.Test(player != null, "Here is needed a valid Player"); m_player = player; m_player.m_onTurnStarted += Shoot; }