예제 #1
0
        public override bool CollideWithCircle(CircleCollider c)
        {
            Vector2d separation = Vector2d.Subtract(Location, c.Location);
            double   rad        = Radius + c.Radius;

            return(separation.LengthSquared <= (rad * rad));
        }
예제 #2
0
        public BaseObj(Vector2d loc, double facing)
        {
            Loc       = loc;
            OldLoc    = loc;
            Facing    = facing;
            OldFacing = facing;
            Id        = Misc.GetID();
            Collider  = new CircleCollider(loc, 10);

            Mesh        = Loader.GetMesh("rock.mesh");
            Moment      = 20.0;
            Mass        = 100.0;
            Hits        = 100;
            MaxHits     = Hits;
            Vulnerable  = true;
            DragAmount  = 0.9;
            RDragAmount = 0.8;

            Rockness    = 0;
            Weirdness   = 0;
            Dangerness  = 0;
            GateNum     = -1;
            Shootable   = true;
            Impactable  = true;
            EffectRange = 20;
        }
예제 #3
0
 public FireballShot(Vector2d loc, double facing) : base(loc, facing)
 {
     Collider   = new CircleCollider(loc, 10);
     Mass       = 10;
     Mesh       = Loader.GetBillboard("fireballshot.bb");
     DamageDone = 25;
     Hits       = MaxHits = 15;
 }
예제 #4
0
 public RailgunShot(Vector2d loc, double facing) : base(loc, facing)
 {
     Collider   = new CircleCollider(loc, 10);
     Mass       = 10;
     Mesh       = Loader.GetBillboard("railgunshot.bb");
     DamageDone = 40;
     Hits       = 30;
 }
예제 #5
0
 public ShootgunShot(Vector2d loc, double facing) : base(loc, facing)
 {
     Collider   = new CircleCollider(loc, 10);
     Mass       = 10;
     Mesh       = Loader.GetBillboard("shootshot.bb");
     DamageDone = 1;
     Hits       = 5;
 }
예제 #6
0
 public Cloud(Vector2d loc, double facing) : base(loc, facing)
 {
     Collider  = new CircleCollider(loc, 10);
     Mass      = 10;
     Hits      = 10;
     MaxHits   = Hits;
     Weirdness = 1;
 }
예제 #7
0
 public VulcanShot(Vector2d loc, double facing) : base(loc, facing)
 {
     Collider   = new CircleCollider(loc, 3);
     Mass       = 5;
     Mesh       = Loader.GetBillboard("vulcanshot.bb");
     Hits       = 15;
     MaxHits    = Hits;
     DamageDone = 1;
 }
예제 #8
0
 public Block(Vector2d loc, double facing) : base(loc, facing)
 {
     Collider = new CircleCollider(loc, 10);
     Mass     = 10;
     Hits     = 100;
     MaxHits  = Hits;
     Mesh     = Loader.GetMesh("block.mesh");
     Rockness = 2;
 }
예제 #9
0
 public Rocket(Vector2d loc, double facing, IController ai) : base(loc, facing, ai)
 {
     Mesh        = Loader.GetMesh("rocket.mesh");
     Collider    = new CircleCollider(loc, 3);
     Hits        = 10;
     MaxHits     = Hits;
     Time        = 20;
     Mass        = 10;
     ThrustForce = 30;
 }
예제 #10
0
 public Rock(Vector2d loc, double facing) : base(loc, facing)
 {
     Collider = new CircleCollider(loc, 10);
     Mass     = 10;
     Hits     = 1;
     MaxHits  = Hits;
     RVel     = Misc.Rand.NextDouble() - 0.5;
     Mesh     = Loader.GetMesh("rock.mesh");
     Rockness = 1;
 }
예제 #11
0
 public GrenadeShot(Vector2d loc, double facing) : base(loc, facing)
 {
     Hits       = 11;
     MaxHits    = Hits;
     Collider   = new CircleCollider(loc, 15);
     Mass       = 10;
     RVel       = Misc.Rand.NextDouble() * 4;
     Mesh       = Loader.GetMesh("grenade.mesh");
     DamageDone = 5;
     LifeTime   = 0;
     Shootable  = true;
 }
예제 #12
0
        public BaseShip(Vector2d loc, double facing, IController ai) : base(loc, facing)
        {
            Collider           = new CircleCollider(loc, 10);
            Control            = ai;
            Control.Controlled = this;
            Target             = null;

            Moment      = 20.0;
            Mass        = 100.0;
            Hits        = MaxHits = 100;
            Vulnerable  = true;
            ThrustForce = 10.0;
            DragAmount  = 0.9;
            TurnForce   = 1.0;
            RDragAmount = 0.8;
            BrakeDrag   = 0.90;
            MaxVel      = 10;

            Hits        = MaxHits = 100;
            MaxEnergy   = Energy = 100;
            EnergyRegen = 1;


            Vector2d[] firepoints = new Vector2d[2];
            firepoints[0].X = 20;
            firepoints[0].Y = 2;
            firepoints[1].X = 20;
            firepoints[1].Y = -2;
            Vector2d[] firedirs = new Vector2d[2];
            firedirs[0].X = 1;
            firedirs[0].Y = 0;
            firedirs[1].X = 1;
            firedirs[1].Y = 0;
            WeaponPoint[] weaponpoints = new WeaponPoint[3];
            weaponpoints[0] = WeaponFactory.VulcanPoint(firepoints[0], firedirs[0]);
            weaponpoints[1] = WeaponFactory.VulcanPoint(firepoints[1], firedirs[1]);
            Weapons         = new BaseWeapon[1];
            Weapons[0]      = new BaseWeapon(0, 2, weaponpoints, ShotMode.CYCLE);
        }
예제 #13
0
        public Fan(Vector2d loc, double facing) : base(loc, facing)
        {
            Collider  = new CircleCollider(loc, 10);
            Mass      = 1000;
            Hits      = 150;
            MaxHits   = Hits;
            Mesh      = Loader.GetMesh("fan.mesh");
            RVel      = 0.5;
            Weirdness = 4;

            // Ranges from -1 to +1
            //Force = (Misc.Rand.NextDouble() * 2 - 1);
            if (Misc.Rand.NextDouble() > 0.5)
            {
                Force = 1;
            }
            else
            {
                // This is too much force for a player to escape with current stats.
                // Dangers should be dangerous.
                Force = -1;
            }
        }
예제 #14
0
 public override bool CollideWithCircle(CircleCollider c)
 {
     return(Misc.CollideRayWithCircle(Location, Ray, c.Location, c.Radius));
 }
예제 #15
0
 public virtual bool CollideWithCircle(CircleCollider c)
 {
     return(false);
 }