/// <summary>
        /// The constructor is private: loading screens should
        /// be activated via the static Load method instead.
        /// </summary>
        private LoadingScreen(ScreenManager.ScreenManager screenManager, bool loadingIsSlow,
                              Screen[] screensToLoad)
        {
            this.loadingIsSlow = loadingIsSlow;
            this.screensToLoad = screensToLoad;

            TransitionOnTime = TimeSpan.FromSeconds(0.5);
        }
        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager.ScreenManager screenManager, bool loadingIsSlow,
                                PlayerIndex? controllingPlayer,
                                params Screen[] screensToLoad)
        {
            // Tell all the current screens to transition off.
            foreach (Screen screen in screenManager.GetScreens())
                screen.ExitScreen();

            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen(screenManager,
                                                            loadingIsSlow,
                                                            screensToLoad);

            screenManager.AddScreen(loadingScreen, controllingPlayer);
        }
Exemplo n.º 3
0
        public void initilizeHUD(Screens.GameplayScreen screen)
        {
            GameScreen = screen;
            _screenManager = screen.ScreenManager;
            _playerHP = _screenManager.SpriteBatch;
            font = GameScreen.ScreenManager.Game.Content.Load<SpriteFont>("Fonts\\monofont");

            if (PlayerOne != null)
            {
                _player1HUDAlive = new VisualObject2D();
                _player1HUDAlive.Texture = GameScreen.ScreenManager.Game.Content.Load<Texture2D>("Textures\\Il-Wrath");
                _player1HUDAlive.Position = new Vector2(10, 10);
                _player1HUDAlive.RotationAngle = 0;
                _player1HUDAlive.Origin = new Vector2(0,0);
                _player1HUDAlive.Scale = 0.5f;

                p1HP = new Vector2(60, 10);
            }

            if (PlayerTwo != null)
            {
                _player2HUDAlive = new VisualObject2D();
                _player2HUDAlive.Texture = GameScreen.ScreenManager.Game.Content.Load<Texture2D>("Textures\\Il-Wrath");
                _player2HUDAlive.Position = new Vector2(GameScreen.ScreenDimensions.X-50, 10);
                _player2HUDAlive.RotationAngle = 0;
                _player2HUDAlive.Origin = new Vector2(0, 0);
                _player2HUDAlive.Scale = 0.5f;

                p2HP = new Vector2(GameScreen.ScreenDimensions.X-130, 10);
            }

            if (PlayerThree != null)
            {
                _player3HUDAlive = new VisualObject2D();
                _player3HUDAlive.Texture = GameScreen.ScreenManager.Game.Content.Load<Texture2D>("Textures\\Il-Wrath");
                _player3HUDAlive.Position = new Vector2(10, GameScreen.ScreenDimensions.Y - 60);
                _player3HUDAlive.RotationAngle = 0;
                _player3HUDAlive.Origin = new Vector2(0, 0);
                _player3HUDAlive.Scale = 0.5f;

                p3HP = new Vector2(60, GameScreen.ScreenDimensions.Y - 60);
            }

            if (PlayerFour != null)
            {
                _player4HUDAlive = new VisualObject2D();
                _player4HUDAlive.Texture = GameScreen.ScreenManager.Game.Content.Load<Texture2D>("Textures\\Il-Wrath");
                _player4HUDAlive.Position = new Vector2(GameScreen.ScreenDimensions.X - 50, GameScreen.ScreenDimensions.Y - 60);
                _player4HUDAlive.RotationAngle = 0;
                _player4HUDAlive.Origin = new Vector2(0, 0);
                _player4HUDAlive.Scale = 0.5f;

                p4HP = new Vector2(GameScreen.ScreenDimensions.X - 130, GameScreen.ScreenDimensions.Y - 60);
            }
        }