Ejemplo n.º 1
0
        public BodyBalloonShiny() : base("bodyBalloonShiny.png")
        {
            SetHealthAndMaxHealth(40);
            NormalAnchorPoint = CCPoint.AnchorMiddle;
            // set your types
            Types = new Type[] { Type.BODY };

            // add a central mount point for a weapon
            var weaponMount = new PartMount(this, (CCPoint)ContentSize / 2, Type.GUN);

            weaponMount.MaxTurningAngle = 115f;
            weaponMount.Dz = -1;

            // add mount points for two rotors
            var rotorMount1 = new PartMount(this, new CCPoint(ContentSize.Width / 2, 4), Type.ROTOR);
            var rotorMount2 = new PartMount(this, new CCPoint(ContentSize.Width / 2, ContentSize.Height - 4), Type.ROTOR);

            rotorMount1.Dz = 1;
            rotorMount2.Dz = 1;

            PartMounts = new PartMount[] { weaponMount, rotorMount1, rotorMount2 };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(400);
        }
Ejemplo n.º 2
0
        public BodyPotatoShiny() : base("bodyPotatoShiny.png")
        {
            SetHealthAndMaxHealth(18);
            NormalAnchorPoint = CCPoint.AnchorMiddle;
            // set your types
            Types = new Type[] { Type.BODY };

            // add mount points for two single wings (and a rivaling double wing mount)
            var wingMount1      = new PartMount(this, new CCPoint((ContentSize.Width * 0.75f), (ContentSize.Height / 2) + 5), Type.SINGLE_WING);
            var wingMount2      = new PartMount(this, new CCPoint((ContentSize.Width * 0.75f), (ContentSize.Height / 2) - 5), Type.SINGLE_WING);
            var doubleWingMount = new PartMount(this, new CCPoint((ContentSize.Width * 0.65f), ContentSize.Height / 2), Type.WINGS);

            doubleWingMount.Dz = 2;
            doubleWingMount.PossiblyBlockingPartMounts.Add(wingMount1);
            doubleWingMount.PossiblyBlockingPartMounts.Add(wingMount2);
            wingMount1.PossiblyBlockingPartMounts.Add(doubleWingMount);
            wingMount2.PossiblyBlockingPartMounts.Add(doubleWingMount);
            // add mount points for two rudders
            var rudderMount1 = new PartMount(this, new CCPoint(2f, (ContentSize.Height / 2) + 1), Type.RUDDER);
            var rudderMount2 = new PartMount(this, new CCPoint(2f, (ContentSize.Height / 2) - 1), Type.RUDDER);
            // add a mount for a rotor or weapon
            var rotorMount = new PartMount(this, new CCPoint(ContentSize.Width - 3, ContentSize.Height / 2), Type.ROTOR, Type.GUN);

            rotorMount.MaxTurningAngle = 40f;

            PartMounts = new PartMount[] { wingMount1, wingMount2, doubleWingMount, rudderMount1, rudderMount2, rotorMount };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(35);
        }
Ejemplo n.º 3
0
        public BodyFighterShiny() : base("bodyFighterShiny.png")
        {
            SetHealthAndMaxHealth(30);
            NormalAnchorPoint = CCPoint.AnchorMiddle;
            // set your types
            Types = new Type[] { Type.BODY };

            // add mount points for two single wings
            var wingMount1      = new PartMount(this, new CCPoint(ContentSize.Width * 0.65f, (ContentSize.Height / 2) + 3), Type.SINGLE_WING);
            var wingMount2      = new PartMount(this, new CCPoint(ContentSize.Width * 0.65f, (ContentSize.Height / 2) - 3), Type.SINGLE_WING);
            var doubleWingMount = new PartMount(this, new CCPoint((ContentSize.Width * 0.65f), ContentSize.Height / 2), Type.WINGS);

            doubleWingMount.PossiblyBlockingPartMounts.Add(wingMount1);
            doubleWingMount.PossiblyBlockingPartMounts.Add(wingMount2);
            wingMount1.PossiblyBlockingPartMounts.Add(doubleWingMount);
            wingMount2.PossiblyBlockingPartMounts.Add(doubleWingMount);
            // add mount points for two rudders
            var rudderMount1 = new PartMount(this, new CCPoint(4.5f, (ContentSize.Height / 2) + 1), Type.RUDDER);
            var rudderMount2 = new PartMount(this, new CCPoint(4.5f, (ContentSize.Height / 2) - 1), Type.RUDDER);
            // add a mount for a rotor
            var rotorMount = new PartMount(this, new CCPoint(ContentSize.Width - 1, ContentSize.Height / 2), Type.ROTOR);

            PartMounts = new PartMount[] { wingMount1, wingMount2, doubleWingMount, rudderMount1, rudderMount2, rotorMount };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(55);
        }
Ejemplo n.º 4
0
        public TestWings() : base("testWings.png")
        {
            // set your types
            Types             = new Type[] { Type.WINGS };
            NormalAnchorPoint = CCPoint.AnchorMiddle;

            // add a mount point for two engines at the center of each wing
            var engineMount1 = new PartMount(this, new CCPoint(ContentSize.Width / 2, (ContentSize.Height / 2) + (ContentSize.Height / 4)), Type.ENGINE);
            var engineMount2 = new PartMount(this, new CCPoint(ContentSize.Width / 2, (ContentSize.Height / 2) - (ContentSize.Height / 4)), Type.ENGINE);
            // add mount points for two guns a bit further out
            var gunMount1 = new PartMount(this, new CCPoint(ContentSize.Width / 2, (ContentSize.Height - (ContentSize.Height / 6))), Type.GUN);
            var gunMount2 = new PartMount(this, new CCPoint(ContentSize.Width / 2, ContentSize.Height / 6), Type.GUN);

            gunMount1.NullRotation = -20f;
            gunMount1.Dz           = 1;
            gunMount2.NullRotation = 20f;
            gunMount2.Dz           = 1;
            PartMounts             = new PartMount[] { engineMount1, engineMount2, gunMount1, gunMount2 };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = new MassPoint[] { new MassPoint((ContentSize.Width / 2) - 1, ContentSize.Height, 30), new MassPoint((ContentSize.Width / 2), (ContentSize.Height / 2) + (ContentSize.Height / 6), 50), new MassPoint((ContentSize.Width / 2), (ContentSize.Height / 2) - (ContentSize.Height / 6), 50), new MassPoint((ContentSize.Width / 2) - 1, 0, 30) };
        }
Ejemplo n.º 5
0
        public BodyBigBomberShiny() : base("bodyBigBomberShiny.png")
        {
            SetHealthAndMaxHealth(80);
            NormalAnchorPoint = CCPoint.AnchorMiddle;
            // set your types
            Types = new Type[] { Type.BODY };

            // NEW: add mount points for two single wings
            var wingMount1 = new PartMount(this, new CCPoint((ContentSize.Width * 0.62f), (ContentSize.Height / 2) + 4), Type.SINGLE_WING);
            var wingMount2 = new PartMount(this, new CCPoint((ContentSize.Width * 0.62f), (ContentSize.Height / 2) - 4), Type.SINGLE_WING);
            // add mount points for two rudders
            var rudderMount1 = new PartMount(this, new CCPoint(11f, (ContentSize.Height / 2) + 2), Type.RUDDER);
            var rudderMount2 = new PartMount(this, new CCPoint(11f, (ContentSize.Height / 2) - 2), Type.RUDDER);
            // add a mount for a weapon
            var gunMount = new PartMount(this, new CCPoint(31, ContentSize.Height / 2), Type.GUN);

            gunMount.MaxTurningAngle = 180f;

            PartMounts = new PartMount[] { wingMount1, wingMount2, rudderMount1, rudderMount2, gunMount };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(160);
        }
Ejemplo n.º 6
0
        internal void CollideWithAircraft(Aircraft aircraft)
        {
            // collect all parts that you could collide with right now and then choose the one that is lowest in the mount hierarchy
            List <Part> collidingParts = new List <Part>();

            // check if you really collide with it (at this point you only know that you collided with its bounding box)
            foreach (var part in aircraft.TotalParts)
            {
                if (part.MyState != Part.State.DESTROYED && Collisions.Collide(this, part))
                {
                    collidingParts.Add(part);
                }
            }
            Part lowestPart      = null;
            int  maxMountParents = -1;

            foreach (var part in collidingParts)
            {
                int mountParents = part.NumOfMountParents();
                if (mountParents > maxMountParents)
                {
                    lowestPart      = part;
                    maxMountParents = mountParents;
                }
            }
            if (lowestPart != null)
            {
                CCPoint collisionPos = Collisions.CollisionPosLinePoly((CollisionTypeLine)CollisionType, lowestPart);
                StandardCollisionBehaviour(lowestPart, collisionPos);
            }
        }
Ejemplo n.º 7
0
        public BodyJet() : base("bodyJet.png")
        {
            SetHealthAndMaxHealth(40);
            NormalAnchorPoint = CCPoint.AnchorMiddle;
            // set your types
            Types = new Type[] { Type.BODY };

            // add mount points for two single wings
            var wingMount1 = new PartMount(this, new CCPoint(ContentSize.Width * 0.4f, (ContentSize.Height / 2) + 5), Type.SINGLE_WING);
            var wingMount2 = new PartMount(this, new CCPoint(ContentSize.Width * 0.4f, (ContentSize.Height / 2) - 5), Type.SINGLE_WING);
            // add mount points for two rudders
            var rudderMount1 = new PartMount(this, new CCPoint(6f, (ContentSize.Height / 2) + 2), Type.RUDDER);
            var rudderMount2 = new PartMount(this, new CCPoint(6f, (ContentSize.Height / 2) - 2), Type.RUDDER);

            PartMounts = new PartMount[] { wingMount1, wingMount2, rudderMount1, rudderMount2 };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(80);

            // add a special maneuver ability! (jet propulsion :) )
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 2.75f, (float)Math.Pow(10, 5) * 35.0f);
            ManeuverAbility.CloudTailNode.ReferenceSize *= 2f;
        }
Ejemplo n.º 8
0
        public TestBodyShiny() : base("bodyTestShiny.png")
        {
            SetHealthAndMaxHealth(18);
            NormalAnchorPoint = CCPoint.AnchorMiddle;
            //Position = new CCPoint((ContentSize.Width / 2), (ContentSize.Height / 2));
            // set your types
            Types = new Type[] { Type.BODY };

            // NEW: add mount points for two single wings
            var wingMount1      = new PartMount(this, new CCPoint((ContentSize.Width / 2) + 3f, (ContentSize.Height / 2) + 4), Type.SINGLE_WING);
            var wingMount2      = new PartMount(this, new CCPoint((ContentSize.Width / 2) + 3f, (ContentSize.Height / 2) - 4), Type.SINGLE_WING);
            var doubleWingMount = new PartMount(this, new CCPoint((ContentSize.Width / 2) + 3.5f, (ContentSize.Height / 2)), Type.WINGS);

            doubleWingMount.PossiblyBlockingPartMounts.Add(wingMount1);
            doubleWingMount.PossiblyBlockingPartMounts.Add(wingMount2);
            wingMount1.PossiblyBlockingPartMounts.Add(doubleWingMount);
            wingMount2.PossiblyBlockingPartMounts.Add(doubleWingMount);
            // add mount points for two rudders
            var rudderMount1 = new PartMount(this, new CCPoint(5, (ContentSize.Height / 2) + 1), Type.RUDDER);
            var rudderMount2 = new PartMount(this, new CCPoint(5, (ContentSize.Height / 2) - 1), Type.RUDDER);
            // add a mount for a rotor
            var rotorMount = new PartMount(this, new CCPoint(ContentSize.Width - 5, ContentSize.Height / 2), Type.ROTOR);

            PartMounts = new PartMount[] { wingMount1, wingMount2, doubleWingMount, rudderMount1, rudderMount2, rotorMount };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(55);
            //new MassPoint[] { new MassPoint(ContentSize.Width / 5, ContentSize.Height / 2, 100), new MassPoint(ContentSize.Width - (ContentSize.Width / 5), ContentSize.Height / 2, 90) };
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Check whether a bullet shot now would hit any parts of the TargetAircraft (if the TargetAircraft wouldn't move).
 /// </summary>
 /// <param name="partsInRange"></param>
 /// <returns>whether the bullet would hit</returns>
 internal bool WouldHit()
 {
     Constants.CCDegreesToDxDy(MyPart.TotalRotation, out float dx, out float dy);
     CollisionTypeLine cTypeReachLine = new CollisionTypeLine(MyPart.PositionWorldspace, MyPart.PositionWorldspace + new CCPoint(dx * Reach, dy * Reach));
     foreach (Part part in TargetAircraft.TotalParts)
     {
         if (Collisions.CollidePolygonLine(part, ((CollisionTypePolygon)part.CollisionType), cTypeReachLine))
             return true;
     }
     return false;
 }
Ejemplo n.º 10
0
        public WingBatShiny() : base("wingBatShiny.png")
        {
            SetHealthAndMaxHealth(18);
            // set your types
            Types             = new Type[] { Type.SINGLE_WING };
            NormalAnchorPoint = CCPoint.AnchorMiddleBottom;

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(6f);
        }
Ejemplo n.º 11
0
        public TestEngine() : base("testEngine.png")
        {
            // set your types
            Types             = new Type[] { Type.ENGINE };
            NormalAnchorPoint = CCPoint.AnchorMiddle;

            // specify the mass points
            MassPoints = new MassPoint[] { new MassPoint(ContentSize.Width / 2, ContentSize.Height / 2, 30) };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the engine maneuver abilities
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 0.25f, (float)Math.Pow(10, 5) * 3.0f);//, (float)Math.Pow(10, 5)*0.1f, (float)Math.Pow(10, 5));
        }
Ejemplo n.º 12
0
        public WeaponScrap() : base("weaponScrap.png")
        {
            SetHealthAndMaxHealth(4);
            // set your types
            Types             = new Type[] { Type.GUN };
            NormalAnchorPoint = new CCPoint(1.5f / ContentSize.Width, 0.5f);

            // specify the mass points
            MassPoints = new MassPoint[] { new MassPoint(ContentSize.Width / 2, ContentSize.Height / 2, 12) };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the gun a WeaponAbility
            WeaponAbility = WeaponAbility.CreateScrapWeapon(this);
        }
Ejemplo n.º 13
0
        public TestRotorShiny() : base("rotorTestShiny.png")
        {
            SetHealthAndMaxHealth(11);
            // set your types
            Types             = new Type[] { Type.ROTOR };
            NormalAnchorPoint = new CCPoint(3 / ContentSize.Width, 0.5f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(11f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 7.25f, (float)Math.Pow(10, 5) * 17.0f);
        }
Ejemplo n.º 14
0
        public WingAngel() : base("wingAngel.png")
        {
            SetHealthAndMaxHealth(10);
            // set your types
            Types             = new Type[] { Type.SINGLE_WING };
            NormalAnchorPoint = new CCPoint(0.5f, 1 / ContentSize.Height);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(20f);

            // give it a maneuver ability
            ManeuverAbility = new ManeuverAbility(0, 0, 0, (float)Math.Pow(10, 5) * 3.75f);
        }
Ejemplo n.º 15
0
        public RudderBigBomberShiny() : base("rudderBigBomberShiny.png")
        {
            SetHealthAndMaxHealth(30);
            // set your types
            Types             = new Type[] { Type.RUDDER };
            NormalAnchorPoint = new CCPoint(0.5f, 0f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(35f);

            // specify the collision type
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rudder ManeuverAbility
            ManeuverAbility = new ManeuverAbility(0, 0, (float)Math.Pow(10, 5) * 5f, (float)Math.Pow(10, 5) * 10f);
        }
        public WeaponBigBomberShiny() : base("weaponBigBomberShiny.png")
        {
            SetHealthAndMaxHealth(26);
            // set your types
            Types             = new Type[] { Type.GUN };
            NormalAnchorPoint = new CCPoint(1.5f / ContentSize.Width, 0.5f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(35f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the gun a WeaponAbility
            WeaponAbility = WeaponAbility.CreateBigBomberWeaponShiny(this);
        }
Ejemplo n.º 17
0
        public TestWeaponShiny() : base("weaponTestShiny.png") // for now, as there is no gun sprite yet
        {
            SetHealthAndMaxHealth(8);
            // set your types
            Types             = new Type[] { Type.GUN };
            NormalAnchorPoint = new CCPoint(1 / ContentSize.Width, 0.5f);

            // specify the mass points
            MassPoints = new MassPoint[] { new MassPoint(ContentSize.Width / 2, ContentSize.Height / 2, 30) };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the gun a WeaponAbility
            WeaponAbility = WeaponAbility.CreateTestWeaponShiny(this);
        }
Ejemplo n.º 18
0
        public WeaponFighterShiny() : base("weaponFighterShiny.png")
        {
            SetHealthAndMaxHealth(8);
            // set your types
            Types             = new Type[] { Type.GUN };
            NormalAnchorPoint = CCPoint.AnchorMiddle;

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(12f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the gun a WeaponAbility
            WeaponAbility = WeaponAbility.CreateFighterWeaponShiny(this);
        }
Ejemplo n.º 19
0
        public RudderJet() : base("rudderJet.png")
        {
            SetHealthAndMaxHealth(20);
            // set your types
            Types             = new Type[] { Type.RUDDER };
            NormalAnchorPoint = new CCPoint(5f / ContentSize.Width, 0f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(8f);

            // specify the collision type
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rudder ManeuverAbility
            ManeuverAbility = new ManeuverAbility(0, 0, (float)Math.Pow(10, 5) * 2.5f, (float)Math.Pow(10, 5) * 10f);
        }
Ejemplo n.º 20
0
        public TestRudder() : base("testRudder.png")
        {
            SetHealthAndMaxHealth(4);
            // set your types
            Types             = new Type[] { Type.RUDDER };
            NormalAnchorPoint = new CCPoint(0.5f, 0f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(5f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility(0, 0, (float)Math.Pow(10, 5) * 1f, (float)Math.Pow(10, 5) * 3.0f);
        }
Ejemplo n.º 21
0
        public DoubleWingScrap() : base("doubleWingScrap.png")
        {
            SetHealthAndMaxHealth(22);
            // set your types
            Types             = new Type[] { Type.WINGS };
            NormalAnchorPoint = CCPoint.AnchorMiddle;

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the wings a special ManeuverAbility (allowing to glide forward even after the rotor has been hit)
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 4.25f, (float)Math.Pow(10, 5) * 4.3f);
            ManeuverAbility.CloudTailNode = null;

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(60);
        }
Ejemplo n.º 22
0
        public WingPotato() : base("wingPotato.png")
        {
            SetHealthAndMaxHealth(3);
            // set your types
            Types             = new Type[] { Type.SINGLE_WING };
            NormalAnchorPoint = new CCPoint(0.6f, 2 / ContentSize.Height);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(12f);

            // give it a maneuver ability!
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 1.25f, (float)Math.Pow(10, 5) * 2.0f, (float)Math.Pow(10, 5) * 0.45f, (float)Math.Pow(10, 5) * 0.75f);
            ManeuverAbility.CloudTailNode = null;
        }
Ejemplo n.º 23
0
        public RotorPotato() : base("rotorPotato.png")
        {
            SetHealthAndMaxHealth(5);
            // set your types
            Types             = new Type[] { Type.ROTOR };
            NormalAnchorPoint = new CCPoint(3 / ContentSize.Width, 0.5f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(8f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 0.75f, (float)Math.Pow(10, 5) * 2.0f);
            ManeuverAbility.CloudTailNode.CloudDelay    = 0.5f;
            ManeuverAbility.CloudTailNode.CloudLifeTime = 1.5f;
        }
Ejemplo n.º 24
0
        public RotorBalloonShiny() : base("rotorBalloonShiny.png")
        {
            SetHealthAndMaxHealth(10);
            // set your types
            Types             = new Type[] { Type.ROTOR };
            NormalAnchorPoint = new CCPoint(0.35f, 0.5f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(12f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 0.5f, (float)Math.Pow(10, 5) * 4.0f);
            ManeuverAbility.CloudTailNode.CloudDelay    = 0.35f;
            ManeuverAbility.CloudTailNode.CloudLifeTime = 1.0f;
        }
Ejemplo n.º 25
0
        public RotorBatShiny() : base("rotorBatShiny.png")
        {
            SetHealthAndMaxHealth(8);
            // set your types
            Types             = new Type[] { Type.ROTOR };
            NormalAnchorPoint = new CCPoint(1 / ContentSize.Width, 0.5f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(4f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 0.35f, (float)Math.Pow(10, 5) * 3.5f);
            ManeuverAbility.CloudTailNode.CloudDelay    = 0.2f;
            ManeuverAbility.CloudTailNode.CloudLifeTime = 1.25f;
            ManeuverAbility.CloudTailNode.CloudColor    = new CCColor4B(1f, 0.8f, 1f, 1f);
        }
Ejemplo n.º 26
0
        public WingFighterShiny() : base("wingFighterShiny.png")
        {
            SetHealthAndMaxHealth(25);
            // set your types
            Types             = new Type[] { Type.SINGLE_WING };
            NormalAnchorPoint = new CCPoint(0.5f, 1 / ContentSize.Height);

            // add a mount point for a gun
            var gunMount = new PartMount(this, new CCPoint(ContentSize.Width / 2, ContentSize.Height / 2), Type.GUN);

            gunMount.Dz = -1;
            PartMounts  = new PartMount[] { gunMount };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(18f);
        }
Ejemplo n.º 27
0
        public WingBigBomber() : base("wingBigBomber.png")
        {
            SetHealthAndMaxHealth(40);
            // set your types
            Types             = new Type[] { Type.SINGLE_WING };
            NormalAnchorPoint = new CCPoint(0.5f, 0);

            // add mount points for 2 rotors
            var rotorMount1 = new PartMount(this, new CCPoint(ContentSize.Width - 3f, 8.5f), Type.ROTOR);
            var rotorMount2 = new PartMount(this, new CCPoint(ContentSize.Width - 3f, 21.5f), Type.ROTOR);

            PartMounts = new PartMount[] { rotorMount1, rotorMount2 };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(120f);
        }
Ejemplo n.º 28
0
        public RotorBigBomberShiny() : base("rotorBigBomberShiny.png")
        {
            SetHealthAndMaxHealth(11);
            // set your types
            Types             = new Type[] { Type.ROTOR };
            NormalAnchorPoint = new CCPoint(3 / ContentSize.Width, 0.5f);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(11f);

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // give the rotor ManeuverAbility
            ManeuverAbility = new ManeuverAbility((float)Math.Pow(10, 5) * 3.0f, (float)Math.Pow(10, 5) * 11.0f);
            ManeuverAbility.CloudTailNode.CloudDelay    *= 2;
            ManeuverAbility.CloudTailNode.CloudLifeTime /= 2;
            ManeuverAbility.CloudTailNode.ReferenceSize  = 24f;
        }
Ejemplo n.º 29
0
        public TestWing() : base("testWing.png")
        {
            // set your types
            Types             = new Type[] { Type.SINGLE_WING };
            NormalAnchorPoint = CCPoint.AnchorMiddleBottom;

            // add a mount point for two engines at the center of the wing
            var engineMount = new PartMount(this, new CCPoint(ContentSize.Width / 2, (ContentSize.Height / 2)), Type.ENGINE);
            // add a mount points for a gun a bit further out
            var gunMount = new PartMount(this, new CCPoint(ContentSize.Width / 2, (ContentSize.Height - (ContentSize.Height / 4))), Type.GUN);

            gunMount.NullRotation = -20f;
            gunMount.Dz           = 1;
            PartMounts            = new PartMount[] { engineMount, gunMount };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = new MassPoint[] { new MassPoint((ContentSize.Width / 2) - 1, ContentSize.Height, 30), new MassPoint((ContentSize.Width / 2), (ContentSize.Height / 2) + (ContentSize.Height / 6), 50), new MassPoint((ContentSize.Width / 2), (ContentSize.Height / 2) - (ContentSize.Height / 6), 50), new MassPoint((ContentSize.Width / 2) - 1, 0, 30) };
        }
Ejemplo n.º 30
0
        public TestDoubleWingShiny() : base("doubleWingsTestShiny.png")
        {
            SetHealthAndMaxHealth(17);
            // set your types
            Types             = new Type[] { Type.WINGS };
            NormalAnchorPoint = CCPoint.AnchorMiddle;

            // add mounts points for guns
            var gunMount1 = new PartMount(this, new CCPoint(ContentSize.Width / 2, (ContentSize.Height - (ContentSize.Height / 4))), Type.GUN);
            var gunMount2 = new PartMount(this, new CCPoint(ContentSize.Width / 2, (ContentSize.Height / 4)), Type.GUN);

            gunMount1.Dz = -1;
            gunMount2.Dz = -1;
            PartMounts   = new PartMount[] { gunMount1, gunMount2 };

            // specify the collision polygon
            CollisionType = Collisions.CreateDiamondCollisionPolygon(this);

            // specify the mass points
            MassPoints = CreateDiamondMassPoints(28);
        }