Jump to content



0

selecting some colors


3 replies to this topic

#1 freehabitat OFFLINE  

freehabitat

    Chopper Commander

  • 113 posts
  • Location:Vienna, AUSTRIA

Posted Sun Feb 3, 2008 6:11 PM

hello,...

i thought about someting since a time.

the TIA shows 128(pal104) different colors.
for example, i choose 20 colors out of them. this selection is for a player/missile/whatever ...
and should change by any action (collision,firebutton,.. ).

how can i start with that? i am not shure how to tell the atari that it has only the selected to use and not the whole chart?
it should be simular to random color. just that i can do the step whitch changes the color.

hope this is to understand for others :) ??

best
f.

#2 LS_Dracon OFFLINE  

LS_Dracon

    Moonsweeper

  • 410 posts

Posted Sun Feb 3, 2008 7:14 PM

Do you want a random color, but in a limited range?

#3 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Sun Feb 3, 2008 8:55 PM

If I understand correctly, you want to pre-define a list of 20 colors, use the first color for some object (e.g., player0), and then whenever some event occurs (e.g., pressing the fire button) the color of the object will advance to the next color in the list, and will cycle back to the beginning of the list after it has reached the end?

The easiest way to do that is with an array of ROM data:

   dim current_color = a
   current_color = 0
   player0:
   %11111111
   %11000011
   %11000011
   %11000011
   %11111111
end
   player0x = 80
   player0y = 44
loop
   COLUP0 = player0_color[current_color]
   drawscreen
   if joy0fire then current_color = current_color + 1
   if current_color = 20 then current_color = 0
   goto loop
   data player0_color
   $10,$14,$18,$1C,$40,$44,$48,$4C,$60,$64,$68,$6C,$80,$84,$88,$8C,$C0,$C4,$C8,$CC
end
Michael

#4 freehabitat OFFLINE  

freehabitat

    Chopper Commander

  • 113 posts
  • Location:Vienna, AUSTRIA

Posted Mon Feb 4, 2008 5:13 AM

:) jop, thats what i am looking for.


data player0_color

thats the code i did not know,... thanks a lot

well,.. i tried to include the code in the frame_program but i was not that succsefull this time,... somehow my steering is blocked,...

i guess itīs only the order of priorities... should the loop for colors be a subroutine or something !?

thanks,
Tom

Attached Files


Edited by freehabitat, Mon Feb 4, 2008 8:15 AM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users