256 Colour Tutorial Part 2(V2.62): Difference between revisions

m
mNo edit summary
Line 87: Line 87:
[[Image:8bittut_sprite0.png]]
[[Image:8bittut_sprite0.png]]


If you check, you'll see that the red tips of her antennae were drawn using colour slot 32. Suppose you want them to alter between black and red colours endlessly throughout the ''whole game'', what we can do is, in each game loop, if the slot 32 is <font color='FF0000'>red</font> change it to <font color='000000'>black</font> (where (r, g, b) tuple equals (0, 0, 0) ) , ''else'' change it to <font color='FF0000'>red</font> (where (r, g, b) tuple equals (63, 0, 0) ). This logic can be visualised as follow:
If you check, you'll see that the red tips of her antennae were drawn using colour slot 32. Suppose you want them to alter between black and red colours endlessly throughout the ''whole game'', what we can do is, in each game loop, if the colour of slot 32 is currently <font color='FF0000'>red</font> change it to <font color='000000'>black</font> (where (r, g, b) tuple equals (0, 0, 0) ) , ''else'' change it to <font color='FF0000'>red</font> (where (r, g, b) tuple equals (63, 0, 0) ). This logic can be visualised as follow:


First, on top of the ''Global Script'':  
First, on top of the ''Global Script'':