Class: Goal

Inherits:
Tile show all
Defined in:
lib/ruby-ai/goal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Tile

#[], #inspect

Constructor Details

#initialize(window, coords) ⇒ Goal

Returns a new instance of Goal.



6
7
8
9
10
# File 'lib/ruby-ai/goal.rb', line 6

def initialize(window, coords)
  @image = Gosu::Image.new(window, "#{LIB}/ruby-ai/media/tiny-green.png", false)
  @x = coords[:x]
  @y = coords[:y]
end

Instance Attribute Details

#xObject (readonly)

Returns the value of attribute x.



5
6
7
# File 'lib/ruby-ai/goal.rb', line 5

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



5
6
7
# File 'lib/ruby-ai/goal.rb', line 5

def y
  @y
end

Instance Method Details

#drawObject



12
13
14
# File 'lib/ruby-ai/goal.rb', line 12

def draw
  @image.draw(@x, @y, 1)
end