public MoveTowardsPlayerArgs(float X, float Y, int[][] fl, EntityManager man)
 {
     PlayerX = X;
     PlayerY = Y;
     floor = fl;
     manager = man;
 }
Esempio n. 2
0
        public static void inspect(EntityManager manager)
        {
            Entity entity = manager.getAliveMobAt(Position);
            if (entity != null)
            {
                // do display mob info
            }

            List<Entity> entities = manager.floorItems[Position];
            if (entities != null && entities.Count > 0)
            {
                // do display floor items
            }
        }
Esempio n. 3
0
        public int[][] createDungeon()
        {
            torchList = new List<Entity>();
            roomList = new List<Rectangle>();
            manager = new EntityManager();

            // initialize size of dungeon array and sets everything to unvisited (0)
            floor = new int[dwidth][];
            for (int a = 0; a < floor.Length; a++)
            {
                floor[a] = new int[dheight];
            }

            for (int x = 0; x < floor.Length; x++)
            {
                for (int y = 0; y < floor[x].Length; y++)
                {
                    floor[x][y] = 0;
                }
            }

            // start with single node then recursively split into areas until done
            Node wholeDungeon = new Node(1, 1, dwidth - 2, dheight - 2);
            wholeDungeon.split(floor);
            // now add rooms
            roomList = wholeDungeon.addRooms(floor);
            // now connect the rooms
            wholeDungeon.connectRooms(floor);
            // now draw walls
            paintWalls();
            // now add doors
            addDoors();
            // now add torches
            addTorches();
            // now add stairs up and down
            addStairs();
            // add mobs
            addMobs();

            return floor;
        }