-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.rb
44 lines (33 loc) · 842 Bytes
/
main.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
require 'rubygems'
require 'bundler/setup'
require 'gosu'
require 'logger'
require 'byebug'
require 'oj'
Dir["./utils/*.rb"].each {|file| require file }
Dir["./lib/*.rb"].each {|file| require file }
Dir["./states/*.rb"].each {|file| require file }
Dir["./entities/*/*.rb"].each {|file| require file }
class Tutorial < Gosu::Window
def initialize
super 640, 480
$window = self
$logger = Logger.new(STDOUT)
$rootDir = Dir.pwd
# $gameDir = Dir.new(Dir.pwd + '/game')
pp $rootDir
self.caption = "Tutorial Game"
$states = Lib::StateMachine.new(State::MainMenu.new)
end
def button_down(id)
super
$states.current.button_down(id) if $states.current.respond_to? :button_down
end
def update
$states.current.update
end
def draw
$states.current.draw
end
end
Tutorial.new.show