Example #1
0
 public void DrawFruit(BonusFruit bonusFruit)
 {
     if (bonusFruit.ShowAsFruit)
     {
         DrawBoardSprite(_spriteSet.Fruit[bonusFruit.Type], bonusFruit.Location);
     }
     if (bonusFruit.ShowAsScore)
     {
         var set = _spriteSet.BonusScores[bonusFruit.Type];
         var loc = bonusFruit.Location.Add(-(set.Count - 1) * 0.5m, 0);
         for (int x = 0; x < set.Count; x++)
         {
             DrawBoardSprite(set[x], loc.Add(x, 0));
         }
     }
 }
Example #2
0
        protected Game(UiSystem uiSystem, LevelSetup levelSetup, bool demoMode)
        {
            _uiSystem = uiSystem;

            _gameDraw = new GameDraw(uiSystem.SpriteSet, uiSystem.Display, uiSystem.ScoreBoard);

            _levelSetup = levelSetup;

            if (demoMode)
            {
                _demoMode = true;
                _lives    = 0;
                _stateMachine.ChangeState(GameState.GetReady);
            }
            else
            {
                _lives = 3;
                _stateMachine.ChangeState(GameState.Intro);
            }

            _bonusFruit = new BonusFruit(_levelSetup.FruitLocation);

            StartLevel();
        }