Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

What about the pal() function from pico-8 ? If i want, say, to do a screen fade effect by changing the palette colors just like pico-8 in TIC how would i do it ?

Thanks for the great engine btw.

I see two ways:

  1. you can change palette RGB values directly in the RAM by using poke api function (here are 16 colors * 3 rgb=48 bytes by 0x3FC0 address);
  2. change color index in the PALETTE MAP using poke (here are 16 bytes with color indixes by 0x3FF0 addr);
64K RAM layout
--------------
0000-SCREEN
3FC0-PALETTE
3FF0-PALETTE MAP

Thanks.

(2 edits)

my demo

Hey i think i figured out the method!

Is something like this?

-- author: Victoro

-- desc: fade effect

-- script: lua

t=0

x=104

y=24

mode=0

scr={x=240,y=128}

local function fade()

if t<5 then

poke(0x3fc0,t*50)

poke(0x3fc1,t*50)

poke(0x3fc2,t*50)

return

else

poke(0x3fc0,0)

poke(0x3fc1,0)

poke(0x3fc2,0)

cls()

mode=1

end

end

function TIC()

t=t+0.06

cls()

if mode==0 then fade() end

if mode==1 then

spr(1+(t%6)/3,x,y,-1,4)

print("TIC-80",(scr.x//2)-19,(scr.y//2),t*10)

end

end