Esempio n. 1
0
        public Player()
            : base(Sorting.Tag, "Player", 1)
        {
            Color = Color.Blue;
            BodyShape.FillColor = Color;
            MeleeShape = new CircleShape(MeleeRadius, 3);
            MeleeShape.FillColor = Color;
            MeleeShape.Origin = new Vector2f(MeleeRadius, MeleeRadius);

            Position = Game.Bounds.Center;
            Speed = 100;

            Health = new Stat(MaxHealth);
            Weapons[0] = new Minigun(this);
            Weapons[1] = new Flamer(this);
            SelectedWeapon = Weapons[0];
            IsWeaponUnlocked[0] = true;
        }
Esempio n. 2
0
        public Enemy(Vector position)
            : base(Sorting.Group, "Enemies", 2)
        {
            var roll = MathExtender.Roll(Chance_Fast, Chance_Big);

            if (roll == 0)
            {
                Color = new Color(255, 0, 255);
                Speed = 150;
                Health = new Stat(50);
                Radius = BodyRadius * 0.75f;
                MeleeTime = TimeSpan.FromSeconds(0.4);
                MeleeDamage = -5;
            }
            else if (roll == 1)
            {
                Color = new Color(0, 255, 0);
                Speed = 25;
                Health = new Stat(5000);
                Radius = BodyRadius * 2.0f;
                MeleeTime = TimeSpan.FromSeconds(0.8);
                MeleeDamage = -75;
            }
            else
            {
                Color = new Color(255, 0, 0);
                Speed = 50;
                Health = new Stat(100);
                Radius = BodyRadius;
                MeleeTime = TimeSpan.FromSeconds(1.5);
                MeleeDamage = -10;
            }

            Position = position;
            BodyShape.FillColor = Color;
            BodyShape.Radius = Radius;
            BodyShape.Origin = new Vector2f(Radius, Radius);
            MeleeRadius = Radius / 2.0f;
            MeleeShape = new CircleShape(MeleeRadius, 3);
            MeleeShape.Origin = new Vector2f(MeleeRadius, MeleeRadius);
            MeleeShape.FillColor = Color;

            ApplyDifficulty();
        }
Esempio n. 3
0
        private void ApplyDifficulty()
        {
            switch (Game.Difficulty)
            {
                case Difficulty.Easy:
                    Health *= 0.75f;
                    Speed *= 0.75f;
                    break;
                case Difficulty.Hard:
                    Health *= 2.0f;
                    Speed *= 2.0f;
                    break;
            }

            Health = new Stat(Health.Max);
        }
Esempio n. 4
0
 public Stat(Stat s)
 {
     _max = s.Max;
     _min = s.Min;
     _value = s.Value;
 }
Esempio n. 5
0
 public Stat(Stat s, double value)
 {
     _max = s.Max;
     _min = s.Min;
     Value = value;
 }