forked from NoahMilam/ruby_shootemup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow.rb
More file actions
39 lines (29 loc) · 763 Bytes
/
Copy pathwindow.rb
File metadata and controls
39 lines (29 loc) · 763 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
class Window <Gosu::Window
attr_accessor :current_state
STATE = {:intro => "Intro.new(self)",
:main => "StartMenu.new(self)",
:game => "GamePlay.new(self)",
:password => "Password.new(self)"}
def initialize
super 800, 600, false
self.current_state = eval(STATE[:intro])
@background_image = Gosu::Image.new(self,'outerspace.png', false)
self.caption = "p00psmile"
end
def update
self.current_state.update
end
def draw
self.current_state.draw
@background_image.draw(0, 0, BackgroundLayer)
end
def button_down(id)
self.current_state.button_down(id)
end
def button_up(id)
#self.current_state.button_up(id)
end
def next_state(state)
self.current_state = eval(STATE[state])
end
end