This repository has been archived by the owner on Oct 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.rb
76 lines (68 loc) · 2.54 KB
/
game.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
require 'colorize'
require 'pry'
require 'date'
# Game methods:
require_relative 'sound'
require_relative 'setup'
require_relative 'weeks'
require_relative 'milestones'
require_relative 'end_game'
# Classes:
require_relative 'events_bank'
require_relative 'character'
require_relative 'events_class'
# require_relative 'high_score'
require_relative 'high_score_list'
#high scores list set up, make available at end game
# high_scores = (
# )
# Game slash screen and entry
def welcome_menu
high_score_list = HighScoreList.new
system 'clear'
puts "\n\n =CODER ACADEMY= ".black.on_cyan
puts "
.____________________.
| __________________ |
| I I |
| I ".green+"..The Game..".cyan+" I |
| I I |
| I________________I |
!____________________!
._[________]_.
.____|____________|____.
|::: ____ |
| ~~~~ [-----] |
!______________________!\n".green
puts "\n1. Start new game \n2. View high scores \n3. About Coder Academy \n4. Exit".blue
literal_response = start_music
response = literal_response.to_i
#Make exit messages and invalid messages in new fils for porting
contact_dets = " CODER ACADEMY ".black.on_cyan + "\n\nCoder Academy bootcamps keep up with the industry's increasing and evolving demand for web developers. Through hands-on, project-based coursework, the Coder Academy immersive, industry relevant education provides a time and cost efficient path to become an employable Junior Developer in only 6 months.\n\nThis game will give you a short taste of the Coder Academy Fast Track course!".green + "\n\nWeb: coderacademy.edu.au\nEmail: [email protected]".cyan + "\n\n** Sydney **\nPhone: +61 2 8355 3822\nLevel 2, 7 Kelly Street\nUltimo, NSW 2007\n\n** Melbourne **\nPhone: +61 3 8683 7093\nLevel 13, 120 Spencer Street,\nMelbourne, VIC 3000\n\n** Brisbane **\nPhone: +61 7 3638 6707\n120 Brunswick Street,\nFortitude Valley, QLD 4006".green
case response
when 1
setup_character
when 2
system 'clear'
high_score_list.list_display
gets
welcome_menu
when 3
system 'clear'
puts contact_dets
puts "\nEnter to return to main menu...".blue
gets
welcome_menu
when 4
system 'clear'
puts "Why leave? Can't hack it?\n\n".red
abort
else
puts "\nHuh?? What do you mean '#{literal_response}'? If this reflects your coding ability, you REALLY need this course.".red
puts "\n\nPress enter to try again...".red
gets
welcome_menu
end
end
# It all starts at this function
welcome_menu