Example #1
0
        protected void SpawnMonster(string name, Vector2 position, int delay)
        {
            uint         netId   = Game.NetIdProvider.PopNextNetId();
            AIUnitRecord record  = AIUnitRecord.GetAIUnitRecord(name);
            AIMonster    monster = new AIMonster(netId, record, delay);

            monster.SpawnPosition = position;
            monster.Position      = position;
            monster.DefineGame(Game);
            Game.AddUnitToTeam(monster, TeamId.NEUTRAL);
            Game.Map.AddUnit(monster);
        }
Example #2
0
        public void SpawnCamp(string monsterName, Game game, Vector2 position)
        {
            AIMonster monster = new AIMonster(game.NetIdProvider.PopNextNetId(), AIUnitRecord.GetAIUnitRecord(monsterName), 0);

            monster.Position      = position;
            monster.SpawnPosition = position;
            monster.DefineGame(game);
            game.AddUnitToTeam(monster, TeamId.NEUTRAL);
            game.Map.AddUnit(monster);
            monster.Initialize();
            monster.Create();
        }