draw': undefined method
button_down?' for #<GrassTile:0x2c28b10> (NoMethodError)block in draw'
from main.rb:56:in
each'draw'
from main.rb:59:in
<main>'
def initialize(window)
@x = x
@y = y
@width = width
@height = height
@image = Gosu::Image.new(window, "media/grass.png", false)
@window = window
end
def draw(mouse_x, mouse_y)
if @window.button_down? ...
$window = self
in the Gosu::Window#initialize
, since it is used all through a Gosu game. Stylistically, however, you should be doing the processing in #update
, not #draw
.
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill