Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / undefined method '+' for nil:NilClass <NoMethodError>
- - By Fractional Date 2013-08-09 11:30
Hello,

I'm in need for some help. I got a error I've not been able to solve. I'm using Gosu with Chingu.

Source Code: http://pastebin.com/kxDUkZqn

Help is greatly appreciated!
Parent - - By lol_o2 Date 2013-08-09 13:06
You could give more information about error, like in which line is it.
Looking on your code, it may be something with @velocity_x/y variables. They are not assigned, but I don't know if Chingu shouldn't do this.
Parent - - By Fractional Date 2013-08-09 13:10
I solved the error by removing that line of code. However, my meteor object doesn't appear on the screen even though I've no errors.

Pastebin: http://pastebin.com/tH9HR17v
Project files: http://filebeam.com/6e7d6d274b43cf72a2c4365474230b7d

Please help me, it has been bugging me for a great day now.

Thank you!
Parent - - By EdwinOdesseiron Date 2013-08-09 13:21
def draw
                if(@menu.state? == true)
                        @menu.draw
                end
        end   


I'd guess the problem lies here. You should probably add some kind of draw for meteor. Though I never used Chingu, I think it doesn't differ that much from gosu?
Parent - By Fractional Date 2013-08-09 13:35
It draws automatically if it's a gameobject.

This program I wrote a couple of weeks ago works: http://pastebin.com/GZb3EH3J

But not the one with the source listed above.
Up Topic Gosu / Gosu Exchange / undefined method '+' for nil:NilClass <NoMethodError>

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill