Example #1
0
        public override void Initialize()
        {
            base.Initialize();

            lootValue = LootValue.high;

            AddPrimaryModule(3000, ShootingMode.Regular);
            primaryModule.SetRandomCharge(random);

            Damage       = (float)CollisionDamage.high;
            Speed        = 0.035f;
            HP           = 400;
            HPmax        = HP;
            TurningSpeed = 2;

            movement            = Movement.Following;
            SightRange          = 400;
            PrimaryShootSoundID = SoundEffects.SmallLaser;

            //Animationer
            anim.LoopTime = 500;
            anim.AddFrame(spriteSheet.GetSubSprite(new Rectangle(217, 315, 38, 53)));
            CenterPoint = new Vector2(anim.Width / 2, anim.Height / 2);

            int shieldRadius = 150;

            areaCollision = new AreaShieldCollision(Game, this, shieldRadius);
        }
 private static void CollideAreaCollision(AreaShieldCollision area, PlayerBullet obj)
 {
     if (area.SourceObject.ShieldCanTakeHit(obj.Damage))
     {
         area.InflictDamage(obj);
         obj.InflictDamage(area);
     }
 }