Class: Goal
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(window, coords) ⇒ Goal
constructor
A new instance of Goal.
Methods inherited from Tile
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
#x ⇒ Object (readonly)
Returns the value of attribute x.
5 6 7 |
# File 'lib/ruby-ai/goal.rb', line 5 def x @x end |
#y ⇒ Object (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
#draw ⇒ Object
12 13 14 |
# File 'lib/ruby-ai/goal.rb', line 12 def draw @image.draw(@x, @y, 1) end |