New games every week!
Score Saving Bug Fixed... Blog
27th December 2008
*sigh*

I must apologise..

I assumed I was right.

Never assume you're right!



I tried and tested, over and over, and I couldn't find a fault.

And then, this morning, I received an email, and through a couple of back-and-forths discovered that, indeed, there was something really really really quite wrong.
Thanks, Nathan..

I made myself a new fresh install, and tried to find the bug.
The bug happened!
I saw it!
I thought "WTF!?!" and then tried again, with another fresh install.

..
And it didn't happen!

And so I tried again..
No bug
And again..
No bug..
And again and again..
No bugs at all..

ARGH!!!

I must admit, at this point I was truly baffled.

And then, hunting through the code, I noticed why it was happening, and also why I hadn't noticed it earlier.

To start a game, I've been hitting Spacebar. It's right under my thumb, it's quick to get to, and I don't need to find it with the mouse... It's handy to have..

The bug happens when you, instead, click the start button on the menu.

*sigh*

Techy bit
In order to traverse from "Clicked Start Button" to "Start Game", I reused a variable. I made editmode=2, because editmode=1 is how the Editor's button also works.. When it gets to the "Check the keys" bit of the code, it also checks editmode, to see if the buttons have been clicked.
Nice and simple, and a quick way to make clickable buttons work.
Or so I thought.
What actually happens is that the editmode variable doesn't get reset when the game gets going, and because the game think's you're in editmode, it won't save a score..
Damn and blast!
So, now it resets, and everything's the way it should be.

Note to self : FFS, check your buttons occasionally, and stop relying on keypresses!!

Same link, now working!

Now that the code's opened up again, and I'm in the mood for tweaking, I might as well carry on and play with a few things, so expect another update later on tonight. .. Maybe..
Views 71, Upvotes 14  
Daily Blog
New games every week!
Site credits : If you can see it, Jayenkai did it.
(c) Jayenkai 2023 and onwards, RSS feed 4

Blog - Score Saving Bug Fixed... - AGameAWeek