Class: Asteroids::GameWindow

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGameWindow

Returns a new instance of GameWindow.



6
7
8
9
# File 'lib/asteroids.rb', line 6

def initialize
  super(800, 600, false)
  self.caption = 'Asteroids'
end

Instance Attribute Details

#stateObject

Returns the value of attribute state.



4
5
6
# File 'lib/asteroids.rb', line 4

def state
  @state
end

Instance Method Details

#button_down(id) ⇒ Object



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

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

#drawObject



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

def draw
  @state.draw
end

#needs_redraw?Boolean

Returns:

  • (Boolean)


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

def needs_redraw?
  @state.needs_redraw?
end

#updateObject



11
12
13
# File 'lib/asteroids.rb', line 11

def update
  @state.update
end