lib/GameApp.rb
# Allows the player to create a new Hero.
Allows the player to create a new Hero.
Allows the player to create a new Hero .
def new_game
    display_title
    puts "What do they call you, hero?"
    name = gets.chomp
    if name.length != 0
      puts "\n"
      puts "Ahhh, you are #{name}. This is your story..."
      puts "\n"
      @hero = Hero.create({name: name})
      puts "#{@hero.story}"
      sleep(7)
      current_game
    else
      puts "Sorry, I couldn't hear you! (Name must be at least 1 character.)"
      sleep(3)
      new_game
    end
  end
def new_game display_title puts "What do they call you, hero?" name = gets . chomp if name . length != 0 puts "\n" puts "Ahhh, you are #{name}. This is your story..." puts "\n" @hero = Hero . create ( { name : name } ) puts "#{@hero.story}" sleep ( 7 ) current_game else puts "Sorry, I couldn't hear you! (Name must be at least 1 character.)" sleep ( 3 ) new_game end end
Allows the player to create a new Hero.
Allows the player to create a new Hero .