Brian's Man Cave Posted August 7, 2021 Share Posted August 7, 2021 Is it possible to change a specific card background so it doesn't show the main BG color? I seem to be able to only control the foreground.. Say the background color is blue (set using mode) and I want one card to have red instead. #backtab(20) = SPR37 + SPR_CYAN print at 0 color 6, "Hello" Quote Link to comment Share on other sites More sharing options...
+nanochess Posted August 7, 2021 Share Posted August 7, 2021 (edited) It depends on the video mode you are using. When using Color Stack mode (MODE 0,x,x,x,x) then you change the x values. When using the Foreground/Background mode (MODE 1), then you can change the bitmask ($3600). #card = #backtab(41) #card = (#card AND NOT $3600) + $0200 ' for blue (1) #card = (#card AND NOT $3600) + $0400 ' for red (2) #card = (#card AND NOT $3600) + $2000 ' for green (4) #card = (#card AND NOT $3600) + $1000 ' for gray (8) #backtab(41) = #card BTW you cannot use the background colors >=8 for GROM characters. Edited August 7, 2021 by nanochess Quote Link to comment Share on other sites More sharing options...
Brian's Man Cave Posted August 7, 2021 Author Share Posted August 7, 2021 for my game I am using mode 0,4,0,0,0 to give the level a green background. The score is at the top in the sky, so the numbers have a green background which I am trying to change to blue.. How do I do that? print at 13 color 2, <7>#score Quote Link to comment Share on other sites More sharing options...
+nanochess Posted August 8, 2021 Share Posted August 8, 2021 53 minutes ago, Brian's Man Cave said: for my game I am using mode 0,4,0,0,0 to give the level a green background. The score is at the top in the sky, so the numbers have a green background which I am trying to change to blue.. How do I do that? print at 13 color 2, <7>#score Use mode 0,1,4,0,0 #backtab(20) = $2000 The $2000 mask advances the color stack pointer so it goes from the blue to the green. Quote Link to comment Share on other sites More sharing options...
Brian's Man Cave Posted August 8, 2021 Author Share Posted August 8, 2021 so do I use that along with the print code? because my print statement is at 13 and your example says 20? Quote Link to comment Share on other sites More sharing options...
Kiwi Posted August 8, 2021 Share Posted August 8, 2021 (edited) If the numbers are center of the sky and the sky card start at location 0. mode 0,9,4,0,0 print at 12 color $2002(advance cs to the next color in the chamber)," ".(so it print a space.) print at 13 color 2, <5>#score(5 numbers maximum since 16-bit number is maxed at 65535), print at 19 color $2,"0"(I think you wanted a fake zero here and we're at the last entry of this row.). print at 20 color $2000(advance cs to the 3rd color, black, might be overwritten by the data table so be sure that the first data table entry have advance cs flag attach to it, you can do $2000+tile/color data). EDIT: Red text on green might be hard for people to read on TV screen. So I would pick yellow, or white for the text. The apple catcher sample I made have usage of colorstack mode for the screen, score etc. Edited August 8, 2021 by Kiwi Quote Link to comment Share on other sites More sharing options...
Brian's Man Cave Posted August 8, 2021 Author Share Posted August 8, 2021 oh so the highest a 16 bit variable will go is 65535? Does that mean you have to do a trick to make the score go above that? Quote Link to comment Share on other sites More sharing options...
+nanochess Posted August 8, 2021 Share Posted August 8, 2021 11 minutes ago, Brian's Man Cave said: oh so the highest a 16 bit variable will go is 65535? Does that mean you have to do a trick to make the score go above that? Typically severa games tend to increase score in factors of one hundred, so adding two fixed zero characters is common. You could go up to 6553500. Don't forget to use the UNSIGNED statement in case you are doing comparison of scores values. (at start of game something like UNSIGNED #score) But if you need even more score, you need two 16-bit variables to contain the score. Like this: UNSIGNED #score DIM #score(2) #score(0) = #score(0) + points IF #score(0) > 9999 THEN #score(0) = #score(0) - 10000 #score(1) = #score(1) + 1 END IF PRINT AT 14 COLOR 5,<4>#score(1),<4>#score(0),"00" ' And two extra zeroes for a highest score of 9999999900 points Quote Link to comment Share on other sites More sharing options...
+nanochess Posted August 8, 2021 Share Posted August 8, 2021 1 hour ago, Brian's Man Cave said: so do I use that along with the print code? because my print statement is at 13 and your example says 20? Sorry for that I thought you want a full first line of blue. The Kiwi's example is more near like you want. Quote Link to comment Share on other sites More sharing options...
Kiwi Posted August 8, 2021 Share Posted August 8, 2021 1 hour ago, nanochess said: PRINT AT 14 COLOR 5,<4>#score(1),<4>#score(0),"00" ' And two extra zeroes for a highest score of 9999999900 points This will cause to wrap around the screen at this screen position. 1 hour ago, Brian's Man Cave said: oh so the highest a 16 bit variable will go is 65535? Does that mean you have to do a trick to make the score go above that? How many digits do the score needs to be? If it is a six digits score, have the first 4 digits to be 16-bit variable, then the last 2 digits to be 8-bit variable, so you have 1 spare 16-bit variable to spare. Do a comparsion whenever points are earned, #score>=10000 then score=score+1:#score=#score-10000. I forgot about using common to stack print/variable in print command. Print at 13 color 2,<2>score,<4>#score. You could have an event if the score is over 999999 points by doing if score>99 then print at 13 color 2,"!!!!!!":goto gamewon. I did the score differently with Mad Bomber where each digit is a variable. So I was using 6 8-bit bytes for the scores. It also help points at the GRAM card. I didn't want slowdown when there's many bombs on screen, so this would be quicker for the game to handle the routine. Plus that game was made when Intybasic was blooming, it got it array feature during that time. The game has an event when you reach over 999999 points. I stopped doing scores this way for my current games. 1 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.