//logic check after moving - checks player inventory //checks for hazards, then updates render public InGameRenderInfo moveCheck() { //ends game if player runs out of gold if (player.getGold() < 0) { endGame(1); } //ends game if player runs out of arrows if (player.getNumOfArrows() <= 0) { endGame(2); } //checks for hazards and acts accordingly encounterHazard(map.encounterHazard()); //updates and returns render info updateRender(); return(render); }
/// <summary> /// setting gold locations /// </summary> /// <param name="roomNumber"></param> public void updateExploredAndGold(int roomNumber) { int gold = r.Next(2) + 3; Room rm = new Room(roomNumber); explored.Add(rm); if (!explored.Contains(rm)) { p.setGold(p.getGold() + gold); } }
public void updateGold(Room room) { MyPlayer.setGold(MyPlayer.getGold() + MyMap.updateExploredAndReturnGold(room.getIntegerForm())); }