Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Exchange / Debugging Tips?
- - By wanderinweezard Date 2013-10-16 02:42
I'm struggling with how to help myself figure out a problem when my "game" is doing something wrong or something that I don't understand.  I don't think posting here each time I hit what feels like a wall, is the appropriate approach. (well maybe it is?).  Ruby (and game development) is new to me.  My previous programming experience - I either used an IDE that let you establish breakpoints and you could step through the code (ie. Visual Studio) or has a built-in debugger that let you step through an interactive prompt and view variable contents.  Generally, we would do something equivalent to
puts "MyVariable: #{my_variable}" to see the variable's state at a given point in execution.

What I'm finding is my printed messages are basically useless because methods are called many times a second or that what I think is happening really isn't and I never see the message.

Can anyone share suggestions?  Or, is really the best approach reaching out to the community here to point out the flaws of the code?
Parent - By ml Date 2013-10-16 07:58
People on this forum are very helpful and very responsive. If you copy-and-paste the code you're having trouble with, you'll definitely get some helpful responses. I've also posted some of my Gosu-related questions on http://gamedev.stackexchange.com and I've gotten some good help there.

One good way of getting help on technical issues is to upload your work-in-progress to github, and share the github url on this forum or on stackexchange.

As for debugging, if your printed messages are either generating an infinite loop, or not appearing at all, maybe the first thing to do would be to try to find a way to get the printed message to appear only once at a time (every time you press the space bar, for example).
Parent - - By jlnr (dev) Date 2013-10-16 19:06
I don't know if there is a good graphical debugger for Ruby, but on the command-line, there is ruby-debugger and also this fun little gem: http://pryrepl.org
Parent - By SPK Date 2013-10-16 19:14
RubyMine has one and it's pretty good.
Parent - By wanderinweezard Date 2013-10-17 00:58
Thank you all.  I'll give some of these a try and attempt to solve the problem (most likely newbie mistakes again) before posting.
Up Topic Gosu / Gosu Exchange / Debugging Tips?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill