Пример #1
0
        public Player(ContentManager content, GraphicsDeviceManager graphics, Chara dinoChosen, int index)
        {
            this.dinoChosen = dinoChosen;

            Image = content.Load<Texture2D>("Player/" + dinoChosen.ToString());

            _halfTextureSize = new Vector2(Image.Width / 2, Image.Height / 2);

            ControlScheme = ChosenControl.Gamepad;
            if (index == 1)
            {
                PlayerIndex = PlayerIndex.One;
            }
            else
            {
                PlayerIndex = PlayerIndex.Two;
            }

            Position = Vector2.Zero;
            Movement = Vector2.Zero;

            _laserPowerLevel = 1;// 4; change back to 4 for debug lasers
            Points = 0;
            if (dinoChosen == Chara.Bronto)
            {
                _maxHealth = 100;
                _maxCharge = 100;
            }
            else if (dinoChosen == Chara.Trex)
            {
                _maxHealth = 125;
                _maxCharge = 125;
            }
            else if (dinoChosen == Chara.Ptera)
            {
                _maxHealth = 75;
                _maxCharge = 150;
            }
            else if (dinoChosen == Chara.Cera)
            {
                _maxHealth = 150;
                _maxCharge = 75;
            }

            _currentHealth = _maxHealth;
            CurrentLazerCharge = _maxCharge;
        }