-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathchidraqul9.rb
More file actions
executable file
·65 lines (54 loc) · 861 Bytes
/
chidraqul9.rb
File metadata and controls
executable file
·65 lines (54 loc) · 861 Bytes
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
#!/usr/bin/ruby
require_relative 'game_engine'
require_relative 'game_base'
require_relative 'world'
require_relative 'hud'
require_relative 'keypresses'
require_relative 'other/os/lib/os'
require_relative 'base'
require_relative 'menu'
$posX=0
$posY=0
$menu = MainMenu.new
$options = Options.new
#entry point
def init_game
menu_main
end
def menu_main
$menu.main
end
def options_main
$options.main
end
def move_down
if ($posY < $WORLD_SIZE_Y)
$posY += 1
end
end
def move_up
if ($posY > 0)
$posY -= 1
end
end
def move_right
if ($posX < $WORLD_SIZE_X)
$posX += 1
end
end
def move_left
if ($posX > 0)
$posX -= 1
end
end
def game_main
loop do
keypress_tick
game_engine_tick
print_world
print_hud
end
end
if __FILE__ == $0
init_game
end