Skip to content

Commit

Permalink
Class gretting created
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCoffey committed Oct 17, 2014
1 parent 9932458 commit 42fd560
Showing 1 changed file with 47 additions and 40 deletions.
87 changes: 47 additions & 40 deletions dungeon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,44 @@ def go(direction)
show_current_description
end

class Gretting

def game_init
gretting = puts "Elf: Wellcome strainger do you have any name ?\n"
puts "Yes my name is .. :"
@name = gets.chomp!.capitalize

while @name.length <= 0
puts "Elf: What is your name strainger:\n"
@name = gets.chomp!.capitalize
end


puts "\nElf: So your name is #{@name} uuhh!, dude! do have any idea of where on earth are you?, this isn't a place for racional people, best if you run away...\n "

early_choise = false
while early_choise == false
puts "What you wanna do ?\n"

puts "1. Leave"
puts "2. Keep on"

option = gets.chomp.to_i

if option == 1
puts "You: OMG! i didn't notice, see ya! faggot"
puts "Game Over"
early_choise = true
exit
elsif option == 2
puts "You: Shut up, and get out of my way!"
early_choise = true
end
end
puts "Elf: Well done strainger!, it's time to chose your class\n"
end
end

class Player
attr_accessor :name, :location

Expand Down Expand Up @@ -97,51 +135,20 @@ def full_description
end
end


gretting = puts "Elf: Wellcome strainger do you have any name ?\n"
puts "Yes my name is .. :"
@name = gets.chomp!.capitalize

while @name.length <= 0
puts "Elf: What is your name strainger:\n"
@name = gets.chomp!.capitalize
end


puts "\nElf: So your name is #{@name} uuhh!, dude! do have any idea of where on earth are you?, this isn't a place for racional people, best if you run away...\n "

early_choise = false
while early_choise == false
puts "What you wanna do ?\n"

puts "1. Leave"
puts "2. Keep on"

option = gets.chomp.to_i

if option == 1
puts "You: OMG! i didn't notice, see ya! faggot"
puts "Game Over"
early_choise = true
exit
elsif option == 2
puts "You: Shut up, and get out of my way!"
early_choise = true
end
end
gretting = Dungeon::Gretting.new
gretting.game_init



puts "Elf: Well done strainger!, it's time to chose your class\n"

new_player = Dungeon::Player.new("#{@name}")
puts new_player.type_player


# Create the main dungeon object
my_dungeon = Dungeon.new("#{@name}")
# Add rooms to the dungeon
my_dungeon.add_room(:largecave, "Large Cave", "a large cavernous cave", { :west => :smallcave })
my_dungeon.add_room(:smallcave, "Small Cave", "a small, claustrophobic cave", { :east => :largecave })
# Start the dungeon by placing the player in the large cave
my_dungeon.start(:largecave)
# Create the main dungeon object
my_dungeon = Dungeon.new("#{@name}")
# Add rooms to the dungeon
my_dungeon.add_room(:largecave, "Large Cave", "a large cavernous cave", { :west => :smallcave })
my_dungeon.add_room(:smallcave, "Small Cave", "a small, claustrophobic cave", { :east => :largecave })
# Start the dungeon by placing the player in the large cave
my_dungeon.start(:largecave)

0 comments on commit 42fd560

Please sign in to comment.