Beispiel #1
0
 public override void RunControlInput(GameResult gameResult, float dt)
 {
     UpdateActions(gameResult, dt);
     base.RunControlInput(gameResult, dt);
 }
Beispiel #2
0
 public void UpdateActions(GameResult gameResult, float dt)
 {
     actions.UpdateActions(gameResult, dt, this.currentControlInput);
 }
 public virtual void OnCreation(GameResult gameResult, ISolidWeapon solidHost, IWeaponsLogic parentWeapon)
 {
     this.solidHost        = solidHost;
     this.solidHost.Target = parentWeapon.Target;
     OnCreation(gameResult, (IWeapon)solidHost, parentWeapon);
 }
        public virtual void AddObjects()
        {
            GameResult gameResult = new GameResult();

            AsteroidFaction.FactionType    = FactionType.Debris;
            SuperMeleeData.AfterChoiceWait = 0;

            IShip ship = GetNewShip(player1);

            if (player1IsAI)
            {
                ship.AddControler(null, new ComplexAIControler());
            }
            else
            {
                SuperMeleeData.AfterChoiceWait = 2500;
                PlayerControler c1 = new PlayerControler(this.player1config);
                data.controlers.Add(c1);
                ship.AddControler(null, c1);
            }
            data.AddShip(gameResult, ship, player1);

            IShip ship2 = GetNewShip(player2);

            if (player2IsAI)
            {
                ship2.AddControler(null, new ComplexAIControler());
            }
            else
            {
                SuperMeleeData.AfterChoiceWait = 2500;
                PlayerControler c2 = new PlayerControler(this.player2config);
                data.controlers.Add(c2);
                ship2.AddControler(null, c2);
            }
            data.AddShip(gameResult, ship2, player2);
            if (ship2 == null)
            {
                return;
            }
            data.SetTarget(ship2);
            data.SetTarget(ship);
            //ship2.Target = ship;
            //ship.Target = ship2;
            for (int pos = 0; pos < player1WingmanCount; ++pos)
            {
                AddAIClone(gameResult, player1, ship2);
            }
            for (int pos = 0; pos < player2WingmanCount; ++pos)
            {
                AddAIClone(gameResult, player2, ship);
            }


            FactionInfo.DefaultFactionCollection.SetDiplomacy(player1, player2, FactionDiplomacy.Enemy);
            PhysicsState tmp = new PhysicsState();

            tmp.Position = new ALVector2D(0, new Vector2D(1500, 1500));
            data.world.AddIGravitySource(Planet.Create(gameResult, tmp));
            data.world.CalcGravity = true;
            World.HandleActionEvents(gameResult);
        }
 public virtual void OnCreation(GameResult gameResult, ISolidWeapon solidHost, IShip source, IAction actionSource)
 {
     this.solidHost        = solidHost;
     this.solidHost.Target = actionSource.Target;
     OnCreation(gameResult, (IWeapon)solidHost, source, actionSource);
 }