Class: RubyArena::Gui

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

Constant Summary collapse

WIDTH =
800
HEIGHT =
600

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#arenaObject (readonly)

Returns the value of attribute arena.



6
7
8
# File 'lib/ruby_arena/gui.rb', line 6

def arena
  @arena
end

#robot_renderersObject (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

#drawObject



19
20
21
22
# File 'lib/ruby_arena/gui.rb', line 19

def draw
  draw_robots
  draw_bullets
end

#updateObject



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

def update
  arena.update
end