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

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:

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.

Project files:

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)

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:

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