Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="adjRoom"></param>
        /// <param name="d"></param>
        /// <returns>True if batted.</returns>
        public bool moveTo(Room adjRoom, Direction d)
        {
            MoveWumpus(false);
            //adjacentRoom.LoadContent(theContentManager);
            // Call map to see if the room in given direction is hazardous.
            //roomType AdjacentRoomType = MyMap.getPlayerInRoomWith(MyRoom);
            //MyMap.GiveWarnings(chamber);

            //updateGold(adjRoom);

            MyPlayer.setTurns(MyPlayer.getTurns() + 1);
            //      If is pitted:
            if (isRoomPitted(adjRoom))
            {
                EncounterPit();
            }
            //      If it contains Wumpus:
            if (adjRoom.Equals(new Room(MyMap.getWumpusRoom())))
            {
                EncounterWumpus();
            }
            //      If is batted (=D)
            if (isRoomBatted(adjRoom))
            {
                adjRoom = EncounterBat();
            }
            // Actually move to the room.
            MyMap.setPlayerRoom(adjRoom);
            MyMap.moves++;
            MyPlayer.setTurns(MyMap.moves);
            // Move Wumpus around
            // Returns player to center:
            ////MyPlayer.Position = new Vector2(RoomSize.Center.X, RoomSize.Center.Y);
            // OR, more realistically, the opposite side:
            MyPlayer.Position = getEntryLocationFrom((Direction)((((int)d + 1) % 4) + 1), MyPlayer.Position);
            return(isRoomBatted(adjRoom));
        }
Пример #2
0
 private void button4_Click(object sender, EventArgs e)
 {
     plr.addTurn();
     label3.Text = "Turns: " + plr.getTurns();
 }