Jump to content
IGNORED

Trying batari - color issues


Yoruk

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by TwentySixHundred
Link to comment
Share on other sites

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 by Yoruk
grammar
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :

 

image.thumb.png.7566f41ecb49906498adb7bcd49fc7ac.png

 

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 :

 

image.png.91c5741ffed169630c6150ccd62a461a.png

 

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

Link to comment
Share on other sites

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

 

image.thumb.png.ad163adb67e7b46d956ecd3046ff8b84.png

helico.bas.bin

Link to comment
Share on other sites

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