Class: RubyArena::BulletRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_arena/bullet_renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ BulletRenderer

Returns a new instance of BulletRenderer.



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

def initialize(args)
  @bullet = args.fetch(:bullet)
  @window = args.fetch(:window)
end

Instance Attribute Details

#bulletObject (readonly)

Returns the value of attribute bullet.



3
4
5
# File 'lib/ruby_arena/bullet_renderer.rb', line 3

def bullet
  @bullet
end

#windowObject (readonly)

Returns the value of attribute window.



3
4
5
# File 'lib/ruby_arena/bullet_renderer.rb', line 3

def window
  @window
end

Instance Method Details

#drawObject



10
11
12
13
14
15
16
17
# File 'lib/ruby_arena/bullet_renderer.rb', line 10

def draw
  window.draw_quad(
    x1, y1, color,
    x1, y2, color,
    x2, y2, color,
    x2, y1, color
  )
end