コード例 #1
0
ファイル: Level.cs プロジェクト: viorelzavoiu/Hyperion
        private static void BuildLevel()
        {
            rooms = new Room[2, 2];

            Room room;
            Item item;

            ////////////////////////////////////////////////////////////////

            // create a Red room
            room = new Room();

            // Assign this room to its location
            rooms[0, 0] = room;

            // Set up the room
            room.Title =  "Red room";
            room.Description = "You have entered the red room. You've got a locked room to the south";
            room.AddExit(Directions.East);

            // create the BLUE BALL

            item = new Item();
            item.Title = "Blue Ball";
            item.PickupText = "you have just picked up the blue ball";

            // adding the item to the room

            room.Items.Add(item);

            //////////////////////////////////////////////////////////////////

            // create a Blue room
            room = new Room();

            // Assign this room to its location
            rooms[1, 0] = room;

            // Set up the room
            room.Title = "Blue room";
            room.Description = "You have entered the Blue room";
            room.AddExit(Directions.West);
            room.AddExit(Directions.South);

            // create the Anvil

            item = new Item();
            item.Title = "Anvil";
            item.PickupText = "you have just picked up the heavy Anvil";
            item.Weight = 6;

            // adding the GREEN BALL

            room.Items.Add(item);

            item = new Item();
            item.Title = "Green Ball";
            item.PickupText = "you have just picked up the Green Ball";
            item.Weight = 1;

            room.Items.Add(item);

            // adding the KEY

             item = new Item();
            item.Title = "Key";
            item.PickupText = "you have just picked up the key for the locked door";
            item.Weight = 1;

            // adding the item to the room

            room.Items.Add(item);

            /////////////////////////////////////////////////////////////////

            // create a Yellow room

            room = new Room();

            // Assign this room to its location
            rooms[1, 1] = room;

            // Set up the room
            room.Title = "Yellow room";
            room.Description = "You have entered the Yellow room";
            room.AddExit(Directions.West);
            room.AddExit(Directions.North);

            // create an item

            item = new Item();
            item.Title = "Red Ball";
            item.PickupText = "you have just picked up the Red ball";

            // adding the item to the room

            room.Items.Add(item);

            //////////////////////////////////////////////////////////////////

            // create a Green room
            room = new Room();

            // Assign this room to its location
            rooms[0, 1] = room;

            // Set up the room
            room.Title = "Green room";
            room.Description = "You have entered the Green room. Theres a locked room to the North";
            room.AddExit(Directions.East);

            // create an item

            item = new Item();
            item.Title = "Yellow Ball";
            item.PickupText = "you have just picked up the yellow ball";

            // adding the item to the room

            room.Items.Add(item);

            //////////////////////////////////////////////////////////////////

            // starting room
            Player.PosX = 0;
            Player.PosY = 0;
        }
コード例 #2
0
ファイル: Level.cs プロジェクト: smtzr/Hyperion
        private static void BuildLevel()
        {
            rooms = new Room[2, 2];

            Room room;
            Item item;

            // create a new room
            room = new Room();

            //Assign this room to location 0, 0
            rooms[0, 0] = room;

            //Setup the room
            room.Title = "Red Room";
            room.Description = "You have entered a red room. There is a locked door to the south";
            room.AddExit(Direction.East);
            //Create a new item

            item = new Item();
            item.Title = "Blue Ball";
            item.PickupText = "You have picked up a blue ball";
            room.Items.Add(item);

            // create a new room
            room = new Room();
            //Assign this room to location 0, 0
            rooms[1, 0] = room;

            //Setup the room
            room.Title = "Blue Room";
            room.Description = "You have entered a blue room";
            room.AddExit(Direction.West);
            room.AddExit(Direction.South);

            item = new Item();
            item.Title = "Anvil";
            item.PickupText = "You struggle to pick up the anvil";
            item.Weight = 6;
            room.Items.Add(item);

            item = new Item();
            item.Title = "Green Ball";
            item.PickupText = "You have picked up a Green Ball";
            room.Items.Add(item);

            item = new Item();
            item.Title = "Key";
            item.PickupText = "You have picked up a key";
            room.Items.Add(item);

            room = new Room();
            rooms[0, 1] = room;
            room.Title = "Green Room";
            room.Description = "You have entered a green room. There is a locked door to the north.";
            room.AddExit(Direction.East);

            item = new Item();
            item.Title = "Yellow Ball";
            item.PickupText = "You have picked up a yellow ball";
            room.Items.Add(item);

            room = new Room();
            rooms[1, 1] = room;
            room.Title = "Yellow Room";
            room.Description = "You have entered a yellow room";
            room.AddExit(Direction.North);
            room.AddExit(Direction.West);

            item = new Item();
            item.Title = "Red Ball";
            item.PickupText = "You have picked up a red ball";
            room.Items.Add(item);

            //Place the player in the starting room.
            Player.PosX = 0;
            Player.PosY = 0;
        }