Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 public static BonusManager GetInstance()
 {
     return(instance ?? (instance = new BonusManager()));
 }
Ejemplo n.º 4
0
 public FallingBonus(Texture2D texture, Body body, BonusMethod strategy) : base(strategy)
 {
     Texture = texture;
     BonusManager.GetInstance();
     this.body = body;
 }