Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.92 KB | None | 0 0
  1. require_relative 'game_engine'
  2. require 'colorize'
  3.  
  4. @game = GameEngine.new
  5.  
  6. greeting       = lambda do
  7.   print "\n\n\t\tWelcome to the Lighthouse Labs Math Game 9000".colorize(:light_red)
  8.   print "\n\n\t\tHow many players will part take in this game? : ".colorize(:light_cyan)
  9. end
  10.  
  11. play_text       = lambda { |name| print "\n\n\t\tEnter the name of the player #{name} or press enter to use the default name: ".colorize(:light_yellow) }
  12.  
  13. gameover_text  = lambda { |name, score| print "\n\n\t\t\t\tGAME-OVER!\n\n\t\t\t\t#{name} has won the game with top score of #{score}!".colorize(:red) }
  14.  
  15. question_text   = lambda { |question| print "\n\n\t\tPlease resolve the following equation: #{question}".colorize(:light_yellow) }
  16.  
  17. p_q_text1       = lambda { |name| print "\n\n\t\tWhat is your answer #{name}".colorize(:blue) }
  18. p_q_text2       = lambda { |name| print "\n\t\tThank you for your answer #{name}".colorize(:light_blue) }
  19.  
  20. resolution_text = lambda { print "\n\n\t\tNow is the time to check the answers!\n\n\t\t".colorize(:light_yellow) }
  21. correct_text    = lambda { |name| print "#{name} that is correct!\n\t\t".colorize(:green) }
  22. incorrect_text  = lambda { |name| print "#{name} that is incorrect!\n\t\t".colorize(:red) }
  23. answer_text     = lambda { |answer| print "\n\t\tThe correct answer was #{answer}".colorize(:light_yellow) }
  24. score_text      = lambda { print "\n\n\t\tLet's take a look at the scoreboard!\n\n\t\t".colorize(:light_yellow) }
  25.  
  26. p_score_text    = lambda { |name, score, lives| print "#{name} currently has score of #{score} and #{lives} lives remaining!\n\t\t".colorize(:light_yellow) }
  27.  
  28. continue_text   = lambda { print "\n\n\t\tType 'y' or 'yes' to continue or press Enter to cancel: " }
  29.  
  30.  
  31. @game.initialize_game(greeting, play_text, continue_text, gameover_text)
  32. @game.loop(question_text, p_q_text1, p_q_text2, resolution_text, correct_text, incorrect_text, answer_text, score_text, p_score_text, continue_text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement