public SpaceshipChasingABehavior(Spaceship spaceship, Vector3 targetPosition)
     : base(spaceship)
 {
     TargetPosition = targetPosition;
     TargetReached = false;
     Targeting = true;
 }
示例#2
0
        public SpaceshipWeapon(Simulator simulator, Spaceship spaceship, double frequency, float attackPoints)
        {
            Simulator = simulator;
            Spaceship = spaceship;

            ShootingFrequency = frequency;
            AttackPoints = attackPoints;

            Bullets = new List<Bullet>();
        }
 public SpaceshipSteeringBehavior(Spaceship spaceship)
 {
     Spaceship = spaceship;
     MaxRotationPerUpdateRad = 0.2f;
     Acceleration = Vector3.Zero;
     MaxAcceleration = 2f;
     ManualMovementInputThisTick = false;
     NextMovement = Vector3.Zero;
     NextRotation = Vector3.Zero;
     Speed = 4;
 }
        public void DoAddSpaceshipAsked(Spaceship spaceship)
        {
            //if (spaceship is TheResistance)
            //    ((TheResistance) spaceship).Enemies = Enemies;

            if (spaceship is SpaceshipAutomaticCollector)
                ((SpaceshipAutomaticCollector) spaceship).Minerals = Minerals;

            spaceship.Initialize();

            Spaceships.Add(spaceship);

            NotifyObjectCreated(spaceship);
        }
        public override void Start()
        {
            SpaceshipSpaceship = new SpaceshipSpaceship(Simulation)
            {
                ShootingFrequency = 100,
                BulletAttackPoints = 50,
                Position = Position,
                VisualPriority = VisualPriorities.Default.PlayerCursor,
                StartingObject = HumanBattleship
            };
            SpaceshipSpaceship.SteeringBehavior.ApplySafeBouncing();

            SfxIn = SpaceshipSpaceship.SfxIn;
            SfxOut = SpaceshipSpaceship.SfxOut;
        }
        private void SyncMineralsCollector(Spaceship Collector)
        {
            if (Collector == null)
                return;

            for (int i = 0; i < Minerals.Count; i++)
            {
                Mineral mineral = Minerals[i];

                if (Physics.CircleCicleCollision(mineral.Circle, Collector.Circle))
                {
                    Output.Add(new KeyValuePair<ICollidable, ICollidable>(mineral, Collector));
                    Output.Add(new KeyValuePair<ICollidable, ICollidable>(Collector, mineral));
                }
            }
        }
示例#7
0
 public void AddSpaceship(Spaceship spaceship)
 {
     SpaceshipsController.DoAddSpaceshipAsked(spaceship);
 }
 public BasicBulletWeapon(Simulator simulator, Spaceship spaceship, double frequency, float attackPoints)
     : base(simulator, spaceship, frequency, attackPoints)
 {
     
 }
示例#9
0
 public MineWeapon(Simulator simulator, Spaceship spaceship)
     : base(simulator, spaceship, double.MaxValue, 70)
 {
     
 }
 public SpaceshipGamePadMBehavior(Spaceship spaceship)
     : base(spaceship)
 {
 }
 public SpaceshipMouseMBehavior(Spaceship spaceship)
     : base(spaceship)
 {
     MaxRotation = MaxRotationPerUpdateRad;
     MaxMouseLengthPxSquared = (float) Math.Pow(12, 2);
 }