Jump to content
IGNORED

scorecolor changes player colour too...?


Recommended Posts

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 by Loccy
Link to comment
https://forums.atariage.com/topic/99535-scorecolor-changes-player-colour-too/
Share on other sites

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.

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.

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 by Loccy

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.

Guest
Reply to this topic...

×   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...