Jump to content



1

Playfield is incorrectly shown at startup


2 replies to this topic

#1 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Fri Jan 20, 2012 10:33 PM

I am working on my next game in Batari Basic. The last one i did was 3 years ago so i must be doing something wrong since i'm quite rusty with bB programming. Anyways when my game is loaded up the first time the gameover playfield is shown briefly and then the actual level playfield is shown. In my code there is a check which checks if the score is 0 or greater then 500000 due to the fact that that score is unobtainable through legal means, but at the beginning when a game is started it sets the score to 3000 so none of those if statements should be triggering yet. There aren't any possible leaks in my code that will have the code jump to that point for no reason. I can't seem to figure it out and wonder of any bB guru's can try to see what's going on. I have attached the latest version of my source code for reference. Any assistance would be greatly appreciated.

Sincerely,

Primordial Ooze

Attached Files



#2 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,923 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Jan 20, 2012 11:14 PM

I think you might be misinterpreting what you are seeing. Run your program with Stella and hit Ctrl + R, let go of both keys and repeat over and over again. All you'll see are random playfield pixels on the screen because you are using drawscreen before the screen has been cleared. A gosub to Level1Data in the StartNewGame section would probably clear that up.

#3 Primordial Ooze OFFLINE  

Primordial Ooze

    Dragonstomper

  • 504 posts
  • Quacker Blaster Lead Programmer
  • Location:United States of America

Posted Sat Jan 21, 2012 1:47 PM

View PostRandom Terrain, on Fri Jan 20, 2012 11:14 PM, said:

I think you might be misinterpreting what you are seeing. Run your program with Stella and hit Ctrl + R, let go of both keys and repeat over and over again. All you'll see are random playfield pixels on the screen because you are using drawscreen before the screen has been cleared. A gosub to Level1Data in the StartNewGame section would probably clear that up.
Thanks, i managed to get it working by moving my drawscreen code to the end of the game loop. This resulted in the same effect as what you stated above minus the extra overhead required for a gosub.

Sincerely,

Primordial Ooze




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users