HI! im making a little demo inspired by old terminals and i had this idea that you can see the character's reflection in terminal screen. however, if i draw the reflection before anything else, it covers the reflection, and if i place it after, well, the reflection now obstructs everything else.
So the idea is to looks something like this:
so i remembered a few carts that did same trickery of layering colors without obstruction, but with new color in result. fair enough, i found this cart on Zep's ambassador page.


as i dug into it, i found out that the trick is in some memory operations, however without any break-downs i cant even remotely understand what it does. I'm not sure if this is the effect im actually going for, but it would be nice to know anyway. Also i might switch this effect to really high-frequency flickering just so the reflection is not so bright and it would be nice layering on top of everything this way. Any of these two options work but im not sure what to go for and how to achieve. maybe i can go with just placing the reflection before everything, and if its getting obstructed -- well, the terminal screen is brighter i guess?



Hi @ioil13,
Try this:
-- transparency tcl=0 brightness=10 -- draw the shadow of sprite n -- from the spritesheet. function shdw(n,x,y,w,h,flip_x,flip_y) w,h=w or 1,h or 1 for i=0,w*8-1 do for j=0,h*8-1 do -- shade the top/left edges if sget((n%16)*8+i,(n\16)*8+j)!=tcl then shadow(x+i,y+j,brightness) end end end end -- uses the spritesheet color- -- picker to choose brightness. off_x=0 off_y=0 function shadow(x,y,brgt) local col = pget(x,y) local col2 = sget(col+off_x,brgt+off_y) pset(x,y,col2) end |
1) put the above code in your PICO-8 cart.
2) draw something like the gradient below in your spritesheet at position off_x, off_y. (or 0, 0.) Make sure it takes up as many columns as there are colors.
3) instead of calling spr() to draw the reflection, call shdw() with the same arguments.
![]() |
[16x16] |
[Please log in to post a comment]