コード例 #1
0
 public GameState()
 {
     PaddleState = new PaddleState();
     BallStates  = new List <BallState>();
     Lives       = 5;
     HudState    = new HudState {
         LivesCount = Lives
     };
     BricksContainerState = new BricksContainerState();
     BricksContainerState.NoMoreBricks += BricksContainerState_NoMoreBricks;
 }
コード例 #2
0
        public void BallDropped(BallState state)
        {
            BallStates.Remove(state);

            HudState.SetLivesChanged(--Lives);

            if (Lives > 0)
            {
                PaddleState.SpawnNewBall();
            }
            else
            {
                GameManager.Instance.Defeat();
            }
        }