Esempio n. 1
0
        // Gameplay control

        protected string SpawnAiBike()
        {
            BaseBike bb = game.CreateBaseBike(BikeFactory.AiCtrl, game.LocalPeerId, BikeDemoData.RandomName(), BikeDemoData.RandomTeam());

            game.PostBikeCreateData(bb); // will result in OnBikeInfo()
            logger.Debug($"{this.ModeName()}: SpawnAiBike({ bb.bikeId})");
            return(bb.bikeId);           // the bike hasn't been added yet, so this id is not valid yet.
        }
Esempio n. 2
0
        protected string SpawnAIBike(string name = null, Team team = null)
        {
            if (name == null)
            {
                name = BikeDemoData.RandomName();
            }

            if (team == null)
            {
                team = BikeDemoData.RandomTeam();
            }

            BaseBike bb = game.CreateBaseBike(BikeFactory.AiCtrl, game.LocalPeerId, name, team);

            game.PostBikeCreateData(bb); // will result in OnBikeInfo()
            logger.Debug($"{this.ModeName()}: SpawnAiBike({ bb.bikeId})");
            return(bb.bikeId);           // the bike hasn't been added yet, so this id is not valid yet.
        }
Esempio n. 3
0
        protected string SpawnPlayerBike()
        {
            // Create one the first time
            string scrName = game.frontend.GetUserSettings().screenName;

            BaseBike bb = game.CreateBaseBike(BikeFactory.LocalPlayerCtrl, game.LocalPeerId, scrName, BikeDemoData.RandomTeam());

            game.PostBikeCreateData(bb); // will result in OnBikeInfo()
            logger.Debug($"{this.ModeName()}: SpawnAiBike({ bb.bikeId})");
            return(bb.bikeId);           // the bike hasn't been added yet, so this id is not valid yet.
        }
Esempio n. 4
0
 protected string SpawnPlayerBike()
 {
     if (settings.localPlayerCtrlType != "none")
     {
         BaseBike bb = game.CreateBaseBike(settings.localPlayerCtrlType, game.LocalPeerId, game.LocalPlayer.Name, BikeDemoData.RandomTeam());
         game.PostBikeCreateData(bb); // will result in OnBikeInfo()
         logger.Debug($"{this.ModeName()}: SpawnPlayerBike({ bb.bikeId})");
         return(bb.bikeId);           // the bike hasn't been added yet, so this id is not valid yet.
     }
     return(null);
 }
Esempio n. 5
0
 protected void _CreateLocalBike(string bikeCtrlType)
 {
     if (bikeCtrlType == "none")
     {
         logger.Info($"No LOCAL PLAYER BIKE created.");
     }
     else
     {
         _localBikesToCreate++;
         string   scrName = game.frontend.GetUserSettings().screenName;
         BaseBike bb      = game.CreateBaseBike(bikeCtrlType, game.LocalPeerId, game.LocalPlayer.Name, BikeDemoData.RandomTeam());
         game.PostBikeCreateData(bb); // will result in OnBikeInfo()
     }
 }