Esempio n. 1
0
        public Player(PlayerTexturePack texturePack, GameTime gameTime, RigidBody rigidBody, Vector2 drawDimensions, GameMap gameMap) : base(PLAYER_HEALTH, PLAYER_LIVES, rigidBody.CollisionPolygon, gameMap)
        {
            playerParticleManager          = new PlayerParticleManager(texturePack, rigidBody.CollisionPolygon, drawDimensions);
            PlayerTexturePack              = texturePack;
            this.gameMap                   = gameMap;
            SpriteManager                  = new SpriteManager(texturePack, gameTime);
            this.drawDimensions            = drawDimensions;
            this.rigidBody                 = rigidBody;
            ClientCollider.CollisionDamage = DEFAULT_PLAYER_DAMAGE;

            healthBar = gameMap.gameSession.graphicsUI.HealthBarManager.AddHealthBar(gameMap.gameSession.DatabaseManager.Username, PLAYER_HEALTH, gameTime);
        }
Esempio n. 2
0
        public void LoadPlayer(PlayerStandards.PlayerType playerType, GameSession gameSession, Lobby lobby, int clientIndex, int entityIndex)
        {
            //Ensure unloaded
            if (spriteManager == null)
            {
                this.playerType = playerType;
                PlayerTexturePack texturePack = PlayerStandards.PlayerTypes[(int)playerType].LoadTexturePack(Content, graphicsDevice);
                spriteManager           = new SpriteManager(texturePack, gameSession.LatestGameTime);
                drawDimensions          = new Vector2(PlayerStandards.PlayerTypes[(int)playerType].GetPlayerScale() * MapStandards.PLAYER_SCALE, PlayerStandards.PlayerTypes[(int)playerType].GetPlayerScale() * MapStandards.PLAYER_SCALE);
                polygonalRepresentation = new RotationRectangle(new RectangleF(PlayerPosition.X - (DrawDimensions.X / 2), PlayerPosition.Y - (DrawDimensions.Y / 2), DrawDimensions.X, DrawDimensions.Y));

                playerParticleManager = new PlayerParticleManager(texturePack, polygonalRepresentation, DrawDimensions);
                clientInfo            = gameSession.NetworkManager.GetClientInfo(clientIndex);
                if (clientInfo != null)
                {
                    healthBar = gameSession.graphicsUI.HealthBarManager.AddHealthBar(clientInfo.Username, Player.PLAYER_HEALTH, gameSession.LatestGameTime);
                }
                else
                {
                    throw new Exception("Error with client info!");
                }
            }
        }
Esempio n. 3
0
 public LocalPlayer(PlayerTexturePack texturePack, RigidBody rigidBody, GameTime gameTime, Vector2 drawDimensions, PlayerStandards.PlayerType PlayerType, GameMap gameMap) : base(texturePack, gameTime, rigidBody, drawDimensions, gameMap)
 {
     this.PlayerType = PlayerType;
     this.rigidBody  = rigidBody;
 }
Esempio n. 4
0
 public PlayerParticleManager(PlayerTexturePack playerTexturePack, Polygon playerPolygon, Vector2 drawScale)
 {
     this.drawScale         = drawScale;
     this.playerTexturePack = playerTexturePack;
     this.playerPolygon     = playerPolygon;
 }