Coolcrab Posted August 26, 2018 Share Posted August 26, 2018 I am trying to save the highscore in my game and for some reason it refuses. I am not sure why this is happening, but I suspect that it has to do with the fact that I use score instead of _sc1, _Sc2, _sc3 or the temp variables. When the game is over I send the code to a goto that compares the score to the HS (0 in the beginning) and save it if its higher. temp1 = score temp2 = score+1 temp3 = score+2 if temp1 > _a then goto __New_High_Score if temp1 < _a then goto __Skip_High_Score if temp2 > _b then goto __New_High_Score if temp2 < _b then goto __Skip_High_Score if temp3 > _c then goto __New_High_Score if temp3 < _c then goto __Skip_High_Score goto __Skip_High_Score __New_High_Score _a = temp1 : _b = temp2 : _c = temp3 __Skip_High_Score _a,_b,_c are all set to 0 at the beginning of the game and are not touched outside of this operation. Then I try to flip back and forth between the current score and the old one by reusing a variable that doesn't get triggered during pause/Game over __scorehs if !_startgame then goto __main ;reuse invisible var to flip HS back & forth _invisible0 = _invisible0 + 1 if _invisible0 > 200 then _invisible0 = 0 temp4 = score temp5 = score+1 temp6 = score+2 if _invisible0 < 100 then scorecolor = $44 if _invisible0 = 100 then _rand1=temp4 : _invisible1=temp5 : _speed=temp6 : temp4 = _a : temp5 = _b : temp6 = _c if _invisible0 > 100 && _invisible0 < 199 then scorecolor = $66 if _invisible0 = 200 then temp4 = _rand1 : temp5 = _invisible1 : temp6 = _speed return It seems to work because the color of the score flips back and forth, but both scores are always the current number and all past HS's are gone. Could anyone take a look at what is going wrong? MonkeyKing0.13.bas score_graphics.asm playerscores.asm Quote Link to comment Share on other sites More sharing options...
Lillapojkenpåön Posted August 26, 2018 Share Posted August 26, 2018 Here's a start, you where not writing anything to the score anywhere so no wonder it doesn't change MonkeyKing0.13.bas Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 26, 2018 Share Posted August 26, 2018 Why not just use what is on the bB page? Those guys worked on it until it was perfect. Screwing with perfection is guaranteed to cause problems. randomterrain.com/atari-2600-memories-batari-basic-commands.html#savehighscore Quote Link to comment Share on other sites More sharing options...
Coolcrab Posted August 26, 2018 Author Share Posted August 26, 2018 Here's a start, you where not writing anything to the score anywhere so no wonder it doesn't change MonkeyKing0.13.bas Ah so you don't have to assign 3 variables to score, its its own variable. That makes everything a lot easier! Thanks a lot for the fix. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.