I have a flashlight method that redraws a bitmaps whenever you change direction, since there's a different shape of the light beam for facing north, west, etc.
Yesterday I started getting an error that I never got before. Once you turned on the flashlight and changed directions a few times (thus redrawing the bitmap a few times) the game crashed on the line
with the error, "Could not draw bitmap".
Today, the problem is gone!
So I figure it had something to do with the program running out of memory?
When you do an assignment line like
does it automatically dispose from memory whatever was all ready in @light.bitmap? Or do you always have to @light.bitmap.dispose beforehand?
Yesterday I started getting an error that I never got before. Once you turned on the flashlight and changed directions a few times (thus redrawing the bitmap a few times) the game crashed on the line
Code:
@light.bitmap = Bitmap.new(1280, 960)
Today, the problem is gone!
So I figure it had something to do with the program running out of memory?
When you do an assignment line like
Code:
@light.bitmap = Bitmap.new(1280, 960)