Monday, March 26, 2012

Stuck on a Define GAH!

So last night I was working dilligently away on my game code for Five Golden Coins. Which mostly means at this stage playing with image sizes and also reworking my game code (helper functions) from Hot Chicks into better Helper code routines. One of the things I do when tidying up like this is to make Defines for variables and help make the code cleaner.

Then whilst i was busy working on my button drawing code the screen went blank when I ran the game. WTF.. I was surprised. Anyway, what followed was a debug session that lasted more than an hour and a half. I was very frustrated and went to bed not solving the issue. Heck even when i had commented out my changes and possible reasons for the black screen it persisted.

Now experience tells me that If i do not find the bug in the place I am loking, it resides elsewhere. Only I could not figure out where. so tonight i attack it again and this time look everywhere but where I did last night.

In the end it comes down to my cleaning up my code. I have a scale factor for my screen, and I changed the variables to Defines and did not make them floats. So the divide always ended up as ZERO! Yup, not 0.9375 like i wanted. I found it fairly quickly tonight, but man, what a depressing thing to happen. I need more time, gah!

Hoping you all have better luck and less bugs,
Da Voodoochief

No comments:

Post a Comment