//Used for player to shoot an arrow into a room of desired direction //Called by Game Control //IF RETURNS TRUE THEN YOU WIN public bool shootArrow(String direction) { Sound s1 = new Sound(); this.arrows--; this.turns++; s1.shootArrow(); updateScore(); bool result = false; if (map.shoot(direction)) { result = true; } return(result); //After this method is called, it shoudld check if //the player has lost or won //i.e. if method returns true, play has won, if false //check if there are > 0 arrows }
//Used for player to shoot an arrow into a room of desired direction //Called by Game Control //IF RETURNS TRUE THEN YOU WIN public bool shootArrow(String direction) { Sound s1 = new Sound(); arrows--; s1.shootArrow(); updateScore(); bool result = false; //call map class to find where wumpus is //if (room == wumpusLocation()) { return true } if (map.shoot(direction)) { result = true; } return(result); //After this method is called, it shoudld check if //the player has lost or won //i.e. if method returns true, play has won, if false //check if there are > 0 arrows }