Yoruk Posted April 29, 2020 Share Posted April 29, 2020 Hello, I'm studying batari Basic and I have strange color issues. I created the attached code with VisualbB, but when running I didn't have my player colors, and the first line of the playfield doesn't use the color defined in the pf color area. (other playfield colors are ok) I'm using player1colors and pfcolors kernel options. I understand that the cost for this is the missile 1, but I don't see why the defined colors are not on the screen. I am doing something wrong ? (Last question : do you prefer to have the code attached as a file, or pasted here ?) Thanks ! default.bas Quote Link to comment Share on other sites More sharing options...
TwentySixHundred Posted April 29, 2020 Share Posted April 29, 2020 10 minutes ago, Yoruk said: Hello, I'm studying batari Basic and I have strange color issues. I created the attached code with VisualbB, but when running I didn't have my player colors, and the first line of the playfield doesn't use the color defined in the pf color area. (other playfield colors are ok) I'm using player1colors and pfcolors kernel options. I understand that the cost for this is the missile 1, but I don't see why the defined colors are not on the screen. I am doing something wrong ? (Last question : do you prefer to have the code attached as a file, or pasted here ?) Thanks ! default.bas 1.94 kB · 1 download It's been awhile since i have used the standard kernels however if my memory serves correct you playerXcolors can only be used with multisprite or DPC+. You would have to set the sprite colors using COLUP0 or COLUP1 unless you change the kernel. Quote Link to comment Share on other sites More sharing options...
Yoruk Posted April 29, 2020 Author Share Posted April 29, 2020 I am studying "Multicolored Sprite" sample that comes with the manual. It does have sprite color, and use only player1colors as kernel. I'll compare this program with mine to see what are the differences... Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted April 29, 2020 Share Posted April 29, 2020 Have you looked here: https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#kernop_pfcolors And yes, an attached file is better. Quote Link to comment Share on other sites More sharing options...
TwentySixHundred Posted April 29, 2020 Share Posted April 29, 2020 (edited) Just opened your program in ADS and compiled. So to start with, as you have kernel option player1colors, you can only define player1's colors and not player0. Secondly you haven't initialized the position of player1 during start up. I have made those quick changes and all looks good to me, here is the .bas file. default.bas Edited April 29, 2020 by TwentySixHundred Quote Link to comment Share on other sites More sharing options...
Yoruk Posted April 29, 2020 Author Share Posted April 29, 2020 (edited) Many thanks ! I works now. I also added player1colors playercolors pfcolors to have both my players in color. I can now focus on my game engine. (Also, very nice avatar ? ) @Random Terrain : yes I was reading through this and the examples attached (still reading). Got some issues to download the page, it was very slow here in France...? Edited April 29, 2020 by Yoruk grammar Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted April 29, 2020 Share Posted April 29, 2020 59 minutes ago, Yoruk said: @Random Terrain : yes I was reading through this and the examples attached (still reading). Got some issues to download the page, it was very slow here in France...? Here it is again in case others have the same problem and a slow connection: Quote Top row bug fix: There seems to be a bug where the top row will not be the color you selected if pfcolors is outside of your main loop. There are two easy fixes. You can either put pfcolors inside your main loop or put COLUPF in your main loop and have it be the color of your top row. If no_blank_lines is used, the top row color will be correct, but the bottom row color will be wrong. Just use 12 colors instead of 11 and make the 12th row the same color as the 11th row. If you use the kernel option background, COLUPF won't work and neither will putting pfcolors inside of the main loop (unless no_blank_lines is also used). If you're not using no_blank_lines, you'll need to use COLUBK. Put COLUBK in your main loop and have it be the color of your top row. If no_blank_lines is used with background, the top row color of your pfcolors definition will be ignored and the bottom row color will be wrong. You'll need to use 12 or 13 colors instead of 11 and play with the color placement until it looks right. Quote Link to comment Share on other sites More sharing options...
TwentySixHundred Posted April 30, 2020 Share Posted April 30, 2020 13 hours ago, Yoruk said: Many thanks ! I works now. I also added player1colors playercolors pfcolors to have both my players in color. I can now focus on my game engine. (Also, very nice avatar ? ) @Random Terrain : yes I was reading through this and the examples attached (still reading). Got some issues to download the page, it was very slow here in France...? Thanks it;s from a game of mine and no worries it's what learning is all about RT's 'commands' page is definitely worth flavoring in your browser for cross referencing. Quote Link to comment Share on other sites More sharing options...
Yoruk Posted April 30, 2020 Author Share Posted April 30, 2020 Ok I made some improvements... My final kernel options are player1colors pfcolors I wanted to use no_blank_lines but I don't want to lost my second missile, so I'll keep it like this now. Here is the actual concept : I want to use the helicopter to shoot enemies. ? Everything works as expected, but I have some issues with the missile. When I shoot, I only have one vertical straight line : And I want an horizontal one, going to the right side. Here is the code of the missile part : if missile0x<250 then goto skip rem missile animation missile0x = missile0x + 2 goto draw_loop skip rem starts missile position if joy0fire then missile0y = player0y - 3 : missile0x = player0x + 8 As you can see, I increment the missile0x value, after setting the initial position when shooting, but why the missile is going in the Ydirection ? Regarding the sample "ex_sprite_with_missile.bas", the missile direction should works by increment the missile0x value... Attached is my full code. Thanks ! helico.bas Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted April 30, 2020 Share Posted April 30, 2020 A missile can be 1 pixel wide, 2 pixels wide, 4 pixels wide, or 8 pixels wide: randomterrain.com/atari-2600-memories-batari-basic-commands.html#nusiz Quote Link to comment Share on other sites More sharing options...
Yoruk Posted April 30, 2020 Author Share Posted April 30, 2020 I changed to this : NUSIZ0 = $10 and missile0height = 4 But I still have a straight line going up...? Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted April 30, 2020 Share Posted April 30, 2020 See how you like this: helico_2020y_04m_30d_1424t.bas Looks like missile0height has to be in the main loop or we get a long line. Quote Link to comment Share on other sites More sharing options...
Yoruk Posted May 1, 2020 Author Share Posted May 1, 2020 Works fine, many thanks ! I started from an example online, thanks also for cleaning / updating labels names. More easier to read now... ? 1 Quote Link to comment Share on other sites More sharing options...
Yoruk Posted May 4, 2020 Author Share Posted May 4, 2020 Made some improvements... Added sound, enemy color sprites and animation for the main player. It's really easy once you get the basic instructions and commands ! ? I don't really like putting a lot of "goto" instructions in my programs but in this case it's a bit hard to avoid them... Too bad also that I can't enable the "no blank line feature", as I need one player color and one missile... helico.bas.bin 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.