Jump to content
  • entries
    4,249
  • comments
    2,525
  • views
    1,750,624

1,000 lines of buggy code

Sign in to follow this  
atari2600land

460 views

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.

Sign in to follow this  


2 Comments


Recommended Comments

BA-7wDYCUAEmjiJ.jpg

You've probably seen that before? ^

 

It sounds like you are making good progress. I think topping out the score is a great idea... as it gives the player a goal. :)

 

I'm glad the roofers are finished... that must have been obnoxious!

 

Is the latest binary online? I rarely check the forums these days. I pop in whenever my email reports that you have made a new blog entry. Hahaha. :)

 

Cheers!

Share this comment


Link to comment

No, I've stopped with the binaries.

Yes, those roofers were quite obnoxious and loud. It's about the time when they would start, and the dog is wondering why there are no noises yet.

Share this comment


Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...