Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. #Start Game
  2. puts "Instructions: Type the letter marked for the options you choose! Enjoy!"
  3. puts "Welcome to Treasure Island"
  4. puts "You are a famous treasure hunter that has spent the last
  5. year looking for the treasure of the Spanish Armada, lost in
  6. in the Atlantic Ocean for centuries."
  7. puts "After a terrible storm your boat has wrecked at a unknown Island."
  8.  
  9. def start_game
  10. puts "You are standing in the beach next to where the boat wrecked."
  11. puts "What do you want to do?"
  12. puts "Options: (w)alk around the island, Walk towards the (j)ungle, Wait for (h)elp"
  13. option1 = gets.chomp
  14. case option1
  15. when "w"
  16. start_walk
  17. when "j"
  18. start_jungle
  19. when "h"
  20. puts "You're are such an embarressment to Chuck Noland's legacy. Man up!"
  21. start_game
  22. else
  23. puts "At least try something, please!"
  24. start_game
  25. end
  26. end
  27.  
  28. def start_walk
  29. puts "After hours walking you can only find sand and more sand."
  30. start_game
  31. end
  32.  
  33. def start_jungle
  34. puts "You walk into the jungle and ends up into having two different paths."
  35. puts "One path leads to the top of the hill where you think you can see the tip of a lighthouse."
  36. puts "The other path leads to what looks like a little river in the distance."
  37. puts "Options: (g)o up hill, Go to (r)iver, return"
  38. option2 = gets.chomp
  39. case option2
  40. when "g"
  41. puts "You see a tall white lighthouse. Something is shinning at the top."
  42. start_lighthouse
  43. when "r"
  44. puts "The river is infested with alligators and you are trapped. You DIED. GAME OVER!"
  45. end_game
  46. when "return"
  47. start_game
  48. end
  49. end
  50.  
  51. def start_lighthouse
  52. puts "There are two ways to go up the tower, inside through the stairs and a rope hanging outside."
  53. puts "Options: Climb through (s)tairs, Climb through (r)ope, return"
  54. option3 = gets.chomp
  55. case option3
  56. when "s"
  57. puts "The stairs are centuries old, they broke in half while you were almost at the top. You fell and DIED. GAME OVER."
  58. end_game
  59. when "r"
  60. puts "The rope is firm and you make your way to the top."
  61. start_light_top
  62. when "return"
  63. start_jungle
  64. end
  65. end
  66.  
  67. def start_light_top
  68. puts "At the top of the lighthouse you see old object similar to a magnifying glass."
  69. puts "Options: Look through the (m)agnifying glass, Lean over the (b)alcony to see the view, return."
  70. option4 = gets.chomp
  71. case option4
  72. when "m"
  73. puts "You see through the glass the location where your boat wrecked. Under it sunken beneath lies the great Santa Isabel, spanish ship where the treasure was known to be."
  74. puts "Congratualations you have found the treasure! However, you have no clue how to leave the island. So sorry..."
  75. end_game
  76. when "b"
  77. "The balcony breaks and you fell. You DIED. GAME OVER!"
  78. end_game
  79. when "return"
  80. start_lighthouse
  81. end
  82. end
  83.  
  84. def end_game
  85. "Thanks for playing."
  86. end
  87.  
  88. start_game
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement