v3n0mn33dl3
Moldy Popcorn
public text 4 hire!
Posts: 33
|
Post by v3n0mn33dl3 on Oct 17, 2010 18:43:45 GMT -5
broke my back last night, playing with basic coding... my code now is pallettes pallette7,0,0,16 sleep 2 pallettes pallette6,0,0,16 sleep 2 pallettes pallette5,0,0,16 sleep 2 pallettes pallette4,0,0,16 sleep 2 pallettes pallette3,0,0,16 sleep 2 pallettes pallette2,0,0,16 sleep 2 pallettes pallette1,0,0,16 sleep 2 pallettes pallette0,0,0,16
in arduino c++ i'm used to do this: for (i=0; i<7; i++){ Serial.print("pallette",i); }
i tried a lot of things but i'm stuck with this... and this is wrong... a=0 FOR Char = i to 7 b=pallette+a pallettes b,0,0,16 sleep 5 next
any suggestions would be very welcom
|
|
|
Post by Tom Maneiro on Oct 17, 2010 22:30:39 GMT -5
What are you trying to do, a sort of fade or pallette animation?
|
|
v3n0mn33dl3
Moldy Popcorn
public text 4 hire!
Posts: 33
|
Post by v3n0mn33dl3 on Oct 18, 2010 5:42:00 GMT -5
What are you trying to do, a sort of fade or pallette animation? it's the intro screen for the game i'm trying to build, it has to cycle through 7 palettes. so i want to join NAME_OF_PALLETE with a NUMBER, cause i like my code as clean/short as possible, so i often use for loops in C++ to do this stuff and use lesser lines of code.
|
|
|
Post by Mairtrus on Oct 18, 2010 7:32:58 GMT -5
There is a small trick that nobody uses: the pallettes function has an extra parameter who allows you to "shift" the pallete's offset: In you case, it should be something like:
for i=0 to 7 pallettes MyPals,0,0,16,32*i next i Since each line of colors is composed by 16 colors, and each colors is 2 bytes long, there is where comes the 32.
|
|
v3n0mn33dl3
Moldy Popcorn
public text 4 hire!
Posts: 33
|
Post by v3n0mn33dl3 on Oct 18, 2010 12:02:05 GMT -5
There is a small trick that nobody uses: the pallettes function has an extra parameter who allows you to "shift" the pallete's offset: In you case, it should be something like: for i=0 to 7 pallettes MyPals,0,0,16,32*i next i Since each line of colors is composed by 16 colors, and each colors is 2 bytes long, there is where comes the 32. right! works like a charm :-) thanx!
|
|