Example #1
0
        public Player(string name, Vector2 position, Texture2D texture)
        {
            Texture = texture;
            Name = name;
            Rotation = 0.0f;
            Position = position;
            AccelerationRate = 8.0f;
            RotationRate = 8.0f;
            Scale = 0.5f;

            MaxHealthPoints = 1000;
            HealthPoints = MaxHealthPoints;

            Money = 0;

            ContentManager cm = GameServices.GetService<ContentManager>();
            Bullet weaponBullet = new Bullet(-30f, 700f, new DisableEffect(2000f), cm.Load<Texture2D>("Textures/bullet"));
            Weapon = new Weapon(weaponBullet, 100f, this);

            HealthBar = new HealthBar(this);
            PlayerControls = ControlsController.GetControls(this);
        }
Example #2
0
        public void Reset()
        {
            AccelerationRate = 8.0f;
            RotationRate = 8.0f;
            MaxHealthPoints = 1000;
            HealthPoints = MaxHealthPoints;
            Dead = false;
            Disabled = false;

            Money = 0;

            ContentManager cm = GameServices.GetService<ContentManager>();
            Bullet weaponBullet = new Bullet(-30f, 700f, new DisableEffect(2000f), Weapon.BulletType.Texture);
            Weapon = new Weapon(weaponBullet, 100f, this);
        }