Top Level Namespace

Includes:
GameMechanics

Defined Under Namespace

Modules: GameMechanics Classes: Choice, Cleric, Dungeon, DungeonMap, EdgeColoringGraph, GameSelect, GiantRat, Goblin, Knight, Kobold, Mobs, NewGame, Rogue, Skeleton, Tavern, Town, Wizard

Constant Summary collapse

DoorNames =
{
  :w => 'wooden door',
  :i => 'iron door',
  :c => 'crack in the wall',
  :r => 'rusty door'
}

Instance Method Summary collapse

Methods included from GameMechanics

#bar_low, #bar_top, #combat, #dice, #is_even?, #load_data, #player_croaks, #prompt, #random_encounter, #restore_player, #save_data, #stat_bar, #yes_no

Instance Method Details

#choose_nameObject



9
10
11
12
13
# File 'lib/destiny.rb', line 9

def choose_name
  puts #formatting
  puts "Please enter your new character's name:"
  prompt; gets.chomp
end

#read_one_line(file_name, line_number) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/destiny.rb', line 15

def read_one_line(file_name, line_number)
  File.open(file_name) do |file|
    current_line = 1
    file.each_line do |line|
      return line.chomp if line_number == current_line
      current_line += 1
    end
  end
end