Something went wrong. Try again.
an npmx inspired game for PICO-8 npicomx.vinnymac.dev
games pico-8 adventure npmx
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273-- decor: ambient decor: candles, ropes, fire pits
function draw_bg_candles() pal(10,9) pal(9,8) -- cooler/dimmer: yellow→orange, orange→red (depth desaturation) for d in all(dec) do if d[1]==1 then local x,y=d[2],d[3]+8 local p=0.5+sin(t()*1.5+x*0.07)*0.5 -- 0..1, slow breath, unique phase per candle local r=1.2+p*1.4 fillp(0x5a5a.8) circfill(x,y+7,r+2,2) fillp() -- dithered purple atmospheric halo circfill(x,y+7,r+0.8,9) -- dark red mid-glow (remapped 9→8) circfill(x,y+7,r,10) -- orange inner (remapped 10→9) if p>0.6 then pset(x,y+7,7) end -- white-hot core at peak spr(41,x-4,y,1,1,false,true) end end pal()end
function draw_roots(x,top) -- dead root tree: old dependency that won't let go line(x,top,x,top+5,4) for i=-1,1 do local bx=x+i*(7+flr(sin(x*0.13+i*0.17)*2)) local by=top+8+flr(sin(x*0.13+i*0.37)*2) line(x,top+3,bx,by,4) line(bx,by,bx+i*2+1,top+14,5) line(bx,by,bx+i*2-2,top+13,5) pset(bx,(t()*6+x*.1)%12+by+2,4) endend
function draw_vine(x,top) -- rotting root: legacy code left to decay local px,py=x,top for i=1,9 do local nx=x+sin(t()*0.38+i*0.22)*(i*0.19) local ny=top+i*3 line(px,py,nx,ny,3) line(px+1,py,nx+1,ny,4) if i%3==1 then pset(nx+2,ny,3) pset(nx-2,ny,4) end px,py=nx,ny end pset(px,py+1,4)end
-- not really decor since it can hurt the player, todo: move to hazardsfunction draw_pit(x) -- a bottomless floor gap: detailed flames climb from the abyss at the screen base, -- tongues of VARYING height (some lick high, some stay low) so there's room to pass. for o=-9,9,2 do local h=24+abs(sin(o*1.7+x))*14+sin(t()*2.5+o*0.6)*5+rnd(4) for d=0,h,1.5 do local f=d/h local sway=sin(t()*2+f*3+o)*f*3 local c=fcol(f) -- white→yellow→orange→red circfill(x+o+sway,128-d,(1-f)*2.4+0.5,c) end endend
function draw_decor() for d in all(dec) do if d[1]==3 then draw_pit(d[2]) elseif d[1]==4 then draw_roots(d[2],d[3]) elseif d[1]==6 then draw_vine(d[2],d[3]) end endend
function update_decor() for d in all(dec) do -- only the LOW part of a pit gap burns; there's room above if d[1]==3 and bf.iv<=0 and abs(bf.x-d[2])<10 and bf.y>84 then hurt() end endend