1,000 lines of buggy code
I sure am glad I caught a rather nasty bug in my game. While working on it, I stumbled upon the fact that the game goes wacko if you reach wave 16. Now I didn't expect anyone to get that far (I wouldn't have if I didn't cheat and make the waves change with 1 point instead of 200.) I found the problem: A good ol' goto command inside a gosub. This is a big no-no, as it causes the stack to increase until the game crashes or something bad happens (in my case, the game quit working and the score began with a lowercase g. G ISN'T A NUMBER.)
So I changed it, and then I broke the powerups. So I had to spend about a couple hours trying to get everything right again. I think I succeeded. So now I have a little over 1,000 lines of WORKING code. More than half of it is defining sprites and screens. If I didn't do that, it'd be <500 lines. But it's working (I think), so that's good. I made the waves after 4 be randomly selected. And I put in a little message if you get past wave 254. The highest wave you can reach is 255. If you get past 255, the waves will still be randomly selected every 200 points.
But even if you get to wave 255, the highest score you can get is 9,999. If you get to wave 255, you'd have 51,000 points, well above 9,999. I made the game so it didn't add anything after 9,999. Why? Because I doubt anyone will get past 9,999 points. I wonder if anyone will ever try to marathon any of my games. I wonder if anyone did before and just didn't tell me.
Another thing I'm glad is that the roofers finished yesterday. I somehow managed to fall asleep while they were working at noon and woke up at 2am. I started working on my game at 3am. Finished at about 5am. It's 6am right now here. And even though it's only 6am, it's still hot in my room.

2 Comments
Recommended Comments