Loccy Posted December 29, 2006 Share Posted December 29, 2006 (edited) I have this at game end (it's quick and dirty, it's solely so I know the game has finished - I will be putting something fancier there longer term) 256 rem ######################### game ended 257 scorecolor = rand 258 drawscreen: goto 257 However the player changes colour as well. Not that it's a big deal, but I'd like to know WHY. Can anyone who knows more about this explain it? (incidentally, if anyone is thinking of taking the plunge, I thoroughly recommend Batari Basic. I picked it up approximately two hours ago. I now have a Scramble-esque scrolling playing field-based landscape, and a plane bombing it. No targets to bomb as of yet, but they'll come Given how much of a headf**k the 2600 is supposed to be to develop for, Batari definitely gives you a BIG leg up) Edited December 29, 2006 by Loccy Quote Link to comment https://forums.atariage.com/topic/99535-scorecolor-changes-player-colour-too/ Share on other sites More sharing options...
+batari Posted December 30, 2006 Share Posted December 30, 2006 I have this at game end (it's quick and dirty, it's solely so I know the game has finished - I will be putting something fancier there longer term) 256 rem ######################### game ended 257 scorecolor = rand 258 drawscreen: goto 257 However the player changes colour as well. Not that it's a big deal, but I'd like to know WHY. Can anyone who knows more about this explain it? (incidentally, if anyone is thinking of taking the plunge, I thoroughly recommend Batari Basic. I picked it up approximately two hours ago. I now have a Scramble-esque scrolling playing field-based landscape, and a plane bombing it. No targets to bomb as of yet, but they'll come Given how much of a headf**k the 2600 is supposed to be to develop for, Batari definitely gives you a BIG leg up) The score digits are actually reused player sprites, and scorecolor is a byte of RAM that is copied to COLUP0 and COLUP1 just before the digits are displayed. Therefore if you want a different player color, you need to set COLUP0 and COLUP1 before every drawscreen. Quote Link to comment https://forums.atariage.com/topic/99535-scorecolor-changes-player-colour-too/#findComment-1206074 Share on other sites More sharing options...
supercat Posted December 30, 2006 Share Posted December 30, 2006 The score digits are actually reused player sprites, and scorecolor is a byte of RAM that is copied to COLUP0 and COLUP1 just before the digits are displayed. Therefore if you want a different player color, you need to set COLUP0 and COLUP1 before every drawscreen. Indeed. Although having to reset COLUP0 and COLUP1 every frame may be a nuisance, and you may (depending upon the game) have to spend a couple bytes to hold their values, for bB to have eliminated such a requirement would have been requiring that he spend two bytes to hold the COLUP0/COLUP1 values even in games where such values either never change or can be easliy determined by other means. Quote Link to comment https://forums.atariage.com/topic/99535-scorecolor-changes-player-colour-too/#findComment-1206109 Share on other sites More sharing options...
Loccy Posted December 30, 2006 Author Share Posted December 30, 2006 (edited) I'm just doodling at the moment more than anything - calling what I have a "game" is giving it a title it doesn't deserve! I was just curious why I was seeing that behaviour. As Batari (the man himself!) said, setting COLUP0 on line 257 did the trick. (Now it's fixed, I think I actually preferred it the way it was - although maybe I should stop tinkering with a game end sequence I have no intention of keeping!) Edited December 30, 2006 by Loccy Quote Link to comment https://forums.atariage.com/topic/99535-scorecolor-changes-player-colour-too/#findComment-1206424 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.