Example #1
0
        //change room
        public void moveRoom(wumpus.common.Direction direction)
        {
            int currentLoc = map.getPlayerLocation();
            int newLoc     = cave.getConnectedRoom(currentLoc, direction);

            bool[] hazards = getHazardArray(newLoc);
            map.changePlayerLocation(newLoc);
            player.updateStatus();
            graphics.update(newLoc);
            hazardWarnings(hazards);
            if (map.pitFall())
            {
                pitInstance();
            }
            if (map.batCheck())
            {
                batInstance();
            }
            if (newLoc == map.getWumpusLocation())
            {
                hazardInstance = true;
                openTrivia(5, 3, 1);
                map.changeWumpusLocation(wumpusFleeLoc(true));
            }
            if (player.getTurn() % 4 == 0)
            {
                graphics.Show("Fun fact: " + trivia.triviaFact());
            }
            sound.playSound(Sound.Sounds.BackgroundMusic);
        }
Example #2
0
 //if user shoots an arrow
 public void shootArrows(wumpus.common.Direction direction)
 {
     arrowDirection             = direction;
     worker                     = new BackgroundWorker();
     worker.DoWork             += new DoWorkEventHandler(waitArrow_DoWork);
     worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler
                                      (arrowDone_RunWorkerCompleted);
     worker.RunWorkerAsync();
 }