예제 #1
0
        public void initilizeHUD(Screens.GameplayScreen screen)
        {
            _gameScreen = screen;

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

                _player1HUDDead = new VisualObject2D();
                _player1HUDDead.Texture = GameScreen.ScreenManager.Game.Content.Load<Texture2D>("Textures\\leftHUD_Dead");
                _player1HUDDead.Position = new Vector2(10, 10);
                _player1HUDDead.RotationAngle = 0;
                _player1HUDDead.Origin = new Vector2(0, 0);
                _player1HUDDead.Scale = 1.0f;
            }

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

                _player2HUDDead = new VisualObject2D();
                _player2HUDDead.Texture = GameScreen.ScreenManager.Game.Content.Load<Texture2D>("Textures\\rightHUD_Dead");
                _player2HUDDead.Position = new Vector2(GameScreen.ScreenDimensions.X - 135, 10);
                _player2HUDDead.RotationAngle = 0;
                _player2HUDDead.Origin = new Vector2(0, 0);
                _player2HUDDead.Scale = 1.0f;
            }

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

                _player3HUDDead = new VisualObject2D();
                _player3HUDDead.Texture = GameScreen.ScreenManager.Game.Content.Load<Texture2D>("Textures\\leftHUD_Dead");
                _player3HUDDead.Position = new Vector2(10, GameScreen.ScreenDimensions.Y - 60);
                _player3HUDDead.RotationAngle = 0;
                _player3HUDDead.Origin = new Vector2(0, 0);
                _player3HUDDead.Scale = 1.0f;
            }

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

                _player4HUDDead = new VisualObject2D();
                _player4HUDDead.Texture = GameScreen.ScreenManager.Game.Content.Load<Texture2D>("Textures\\rightHUD_Dead");
                _player4HUDDead.Position = new Vector2(GameScreen.ScreenDimensions.X - 135, GameScreen.ScreenDimensions.Y - 60);
                _player4HUDDead.RotationAngle = 0;
                _player4HUDDead.Origin = new Vector2(0, 0);
                _player4HUDDead.Scale = 1.0f;
            }
        }
예제 #2
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);
            }
        }