Пример #1
0
        public void Init(LevelManager <PinballLevel> levelManager, Bound bound, Rectangle screenRect)
        {
            ballManager  = BallManager.GetInstance();
            bonusManager = BonusManager.GetInstance();
            scoreManager = ScoreManager.GetInstance();
            this.bound   = bound;
            lifeManager  = LifeManager.GetInstance();
            ScreenRect   = screenRect;

            this.levelManager = levelManager;
        }
Пример #2
0
        public PlayState(int lives)
        {
            bonusManager = BonusManager.GetInstance();
            levelManager = LevelManager <PinballLevel> .GetInstance();

            ballManager  = BallManager.GetInstance();
            scoreManager = ScoreManager.GetInstance();
            gameManager  = GameManager.GetInstance();
            stateManager = StateManager.GetInstance();

            gui = new PlayInterface(GameManager.GetInstance().ScreenRect);
            gui.Initialize(ballManager.GameBallPrototype.Sprite.Clone());
            gui.LivesChanged(lives);
            lifeManager                 = LifeManager.GetInstance();
            lifeManager.Lives           = lives;
            lifeManager.OnLivesChanged += LivesChanged;

            gameManager.OnGameOver += OnGameOver;


            levelManager.SetLevel(1);
        }