Esempio n. 1
0
        public void Init(int mapId, int zoneCells)
        {
            Map.LoadMap(mapId);

            // Zone
            ZoneCells = zoneCells;

            int countY = (Map.SizeY + zoneCells - 1) / zoneCells;
            int countX = (Map.SizeX + zoneCells - 1) / zoneCells;

            Zones = new Zone[countY, countX];

            for (int y = 0; y < countY; y++)
            {
                for (int x = 0; x < countX; x++)
                {
                    Zones[y, x] = new Zone(y, x);
                }
            }


            // temp
            for (int i = 0; i < 300; i++)
            {
                Monster monster = ObjectManager.Instance.Add <Monster>();
                monster.Init(1);
                EnterGame(monster, randomPos: true);
            }
        }