Class: RubyArena::Gui
- Inherits:
-
Gosu::Window
- Object
- Gosu::Window
- RubyArena::Gui
- Defined in:
- lib/ruby_arena/gui.rb
Constant Summary collapse
- WIDTH =
800- HEIGHT =
600
Instance Attribute Summary collapse
-
#arena ⇒ Object
readonly
Returns the value of attribute arena.
-
#robot_renderers ⇒ Object
readonly
Returns the value of attribute robot_renderers.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(arena) ⇒ Gui
constructor
A new instance of Gui.
- #update ⇒ Object
Constructor Details
#initialize(arena) ⇒ Gui
Returns a new instance of Gui.
8 9 10 11 12 13 |
# File 'lib/ruby_arena/gui.rb', line 8 def initialize(arena) @arena = arena @_robot_renderers = {} @_bullet_renderers = {} super(width, height, false) end |
Instance Attribute Details
#arena ⇒ Object (readonly)
Returns the value of attribute arena.
6 7 8 |
# File 'lib/ruby_arena/gui.rb', line 6 def arena @arena end |
#robot_renderers ⇒ Object (readonly)
Returns the value of attribute robot_renderers.
6 7 8 |
# File 'lib/ruby_arena/gui.rb', line 6 def robot_renderers @robot_renderers end |
Instance Method Details
#draw ⇒ Object
19 20 21 22 |
# File 'lib/ruby_arena/gui.rb', line 19 def draw draw_robots draw_bullets end |
#update ⇒ Object
15 16 17 |
# File 'lib/ruby_arena/gui.rb', line 15 def update arena.update end |