Ejemplo n.º 1
0
Archivo: Board.cs Proyecto: paeh/OTMA
        private Room createAndAddRoom(int x, int y, String img)
        {
            var coordinate = new Coordinate(x, y);
            var room = new Room(coordinate, img);
            rooms.Add(coordinate, room);

            return room;
        }
Ejemplo n.º 2
0
Archivo: Board.cs Proyecto: paeh/OTMA
        /// <summary>
        /// Prepares the exit door to end the game.
        /// </summary>
        /// <param name="map3x5">The position of the end door</param>
        /// <returns></returns>
        private ExitDoor createExitDoor(BoardElement map3x5)
        {
            var coordinate = new Coordinate(3, 5);
            var exitDoor = new ExitDoor(coordinate, "/OTMA;component/Images/door.png");
            var exitEvent = new Event("Finish", "Finish", "img");
            var exitRoom = new Room(coordinate, "/OTMA;component/Images/finish.png");

            exitDoor.setRoomEvent(exitEvent);
            exitDoor.setBoundaryItems(exitRoom, null, map3x5, null);
            doors.Add(coordinate, exitDoor);

            exitRoom.setHints(ConfigStub.FINAL_HINTS);
            exitRoom.setStories(ConfigStub.FINAL_STORIES);
            exitRoom.setEvent(exitEvent);
            rooms.Add(coordinate, exitRoom);

            return exitDoor;
        }
Ejemplo n.º 3
0
        private String getRandomRoomContent(Room room)
        {
            var content = room.getRandomContent();

            if (content != null)
            {
                if (!(content is Story))
                {
                    gameEngine.logHint(content);
                }

                return content.text;
            }

            return "";
        }