Ejemplo n.º 1
0
        public bool shoot(Game1WithoutKinect.Direction dir)
        {
            if (MyPlayer.getArrows() >= 1)
            {
                Room NextRoom = MyCave.getConnectedRooms(MyMap.getPlayerRoom().getDecimalForm())[(int)(dir)];
                MyPlayer.setArrows(MyPlayer.getArrows() - 1);
                if (NextRoom != null)
                {
                    won = MyMap.ShootArrow(NextRoom);
                    if (won)
                    {
                        GameState = Gstate.EndGame;
                    }

                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
 public bool ShootArrow(int roomNumber)
 {
     // check if have arrow
     // check if can shoot arrow in that room (to test for errors, basically)
     // updates "won" variable if roomNumber == wumpus;
     if (p.getArrows() < 1)
     {
         // print error
     }
     else if (roomNumber == wumpusRoomInt)
     {
         p.setArrows(p.getArrows() - 1);
         won = true;
     }
     else
     {
         p.setArrows(p.getArrows() - 1);
         // print message & access trivia
     }
     return(won);
 }
Ejemplo n.º 3
0
 public int getArrowCount()
 {
     return(_Player.getArrows());
 }