Example #1
0
        static void Main()
        {
            TCODConsole.initRoot(80, 61, "Lights Out");
            TCODSystem.setFps(100);
            TCODConsole.setKeyboardRepeat(250, 100);
            Game game = new Game();

            game.Draw();
            while (!TCODConsole.isWindowClosed() && !game.Exit)
            {
                game.Update();
            }
        }
Example #2
0
 public void Generate(int level, out Map map, Game game)
 {
     map = new Map(game);
     TCODBsp root = new TCODBsp(1, 1, Map.MAP_WIDTH - 2, Map.MAP_HEIGHT - 2);
     root.splitRecursive(_rand, level, 3, 3, 1.5f, 1.5f);
     //map = new Map(80, 50, new TCODConsole(5, 5));
     GenRoom(root, ref map);
     int x;
     int y;
     FindOpenSpot(out x, out y, map);
     map.SetStartPos(x, y);
     FindOpenSpot(out x, out y, map);
     map.Stair = new Stairs(x, y);
     for (int i = 0; i < 20; i++)
     {
         PlaceRandomItem(map);
     }
 }
Example #3
0
        public Map(Game game)
        {
            _currentMonsterNum = 0;
            _game = game;

            MaxMonster = 10;
            TCODMap = new TCODMap(MAP_WIDTH, MAP_HEIGHT);
            _known = new bool[MAP_WIDTH, MAP_HEIGHT];
            _lights = new List<Light>();
            _monsters = new List<Monster>();
            _items = new List<Item>();
            _dead = new List<Monster>();
            _deadLights = new List<Light>();
            Dijkstra = new Dijkstra(this);

            for (int i = 0; i < MAP_WIDTH; i++)
                for (int j = 0; j < MAP_HEIGHT; j++)
                {
                    this[i, j] = true;
                }
        }