public override void OnCreation(GameResult gameResult, FactionInfo factionInfo)
        {
            base.OnCreation(gameResult, factionInfo);
            int SatelliteCount = subShips.Length;

            for (int pos = 0; pos < SatelliteCount; ++pos)
            {
                subShips[pos].SetAllPositions();
            }
            for (int pos = 0; pos < SatelliteCount; ++pos)
            {
                int pos2 = (pos + 1) % SatelliteCount;
                gameResult.AddJoint(new PinJoint(new CollidablePair(subShips[pos], this), this.current.Position.Linear, 0, .1f));
                gameResult.AddJoint(new PinJoint(new CollidablePair(subShips[pos], subShips[pos2]), subShips[pos2].Current.Position.Linear, .1f, .1f));
            }
        }
Example #2
0
 public override void OnCreation(GameResult gameResult, FactionInfo factionInfo)
 {
     base.OnCreation(gameResult, factionInfo);
     subShips[0].Current.Position = this.current.Position;
     subShips[0].SetAllPositions();
     gameResult.AddJoint(new PinJoint(new CollidablePair(this, subShips[0]), this.current.Position.Linear, 0, .1f));
     subShips[0].IgnoreInfo.IsCollidable = false;
     subShips[0].ShipState = this.shipState;
 }
Example #3
0
        protected virtual void SetStage(GameResult gameResult)
        {
            Vector2D     direction    = Vector2D.FromLengthAndAngle(1, source.Current.Position.Angular + offsetAngle);
            PhysicsState physicsState = new PhysicsState(source.Current);
            float        distance     = source.BoundingRadius + maxBoundingRadius + 5;

            physicsState.Position.Linear  += direction * distance;
            physicsState.Position.Angular += velocityAngle;
            physicsState.Velocity.Angular  = weapons[stage].MovementInfo.MaxAngularVelocity.Value;
            currentWeapon = (ISolidWeapon)weapons[stage].Clone();
            currentWeapon.Current.Set(physicsState);
            currentWeapon.SetAllPositions();

            currentWeapon.OnCreation(gameResult, source, this);
            currentJoint = new PinJoint(new CollidablePair(currentWeapon, source), currentWeapon.Current.Position.Linear, 0, .1f);
            gameResult.AddJoint(currentJoint);
        }