Class: GameWindow

Inherits:
Gosu::Window
  • Object
show all
Defined in:
lib/misc/game_window.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGameWindow

Returns a new instance of GameWindow.



4
5
6
7
8
# File 'lib/misc/game_window.rb', line 4

def initialize
  super((ENV['w'] || 800).to_i,
        (ENV['h'] || 600).to_i,
        (ENV['fs'] ? true : false))
end

Instance Attribute Details

#stateObject

Returns the value of attribute state.



2
3
4
# File 'lib/misc/game_window.rb', line 2

def state
  @state
end

Instance Method Details

#button_down(id) ⇒ Object



27
28
29
# File 'lib/misc/game_window.rb', line 27

def button_down(id)
  @state.button_down(id)
end

#drawObject



15
16
17
# File 'lib/misc/game_window.rb', line 15

def draw
  @state.draw
end

#needs_cursor?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/misc/game_window.rb', line 23

def needs_cursor?
  Utils.update_interval > 200
end

#needs_redraw?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/misc/game_window.rb', line 19

def needs_redraw?
  @state.needs_redraw?
end

#updateObject



10
11
12
13
# File 'lib/misc/game_window.rb', line 10

def update
  Utils.track_update_interval
  @state.update
end