The palette cycling happens once and then stops, I tried using palt(), but this doesn't appear to reset the cycle. Any pointers would be appreciated!
Here's the code I'm using.
function _update()
p+=1
if p>15 then
p=1
end
end
function _draw()
pal(p,p-1,1)
end
|
P#17618 2015-12-09 04:48 ( Edited 2016-02-28 16:07)
:: solar
Hello there.
With your code, once you've made it through all the colours once, you're then making the same changes again, so no change is apparent.
I'm wondering if you meant to do something more like this?
function _update()
p+=1
end
function _draw()
for x=0,15 do
pal(x,(x+p)%16,1)
end
end
|
This will keep looping over all the palette entries every frame.
P#17622 2015-12-09 05:38 ( Edited 2015-12-09 10:46)
:: qbicfeet
^ You don't actually need to use modulo (%) with pal() since the function already handles that internally.
It's absolutely good practice to do it, but it's good to know you can skip it if you really really need those 2 tokens for whatever reason :P
P#17630 2015-12-09 11:22 ( Edited 2015-12-09 16:25)
[Please log in to post a comment]



