Something went wrong. Try again.
an npmx inspired game for PICO-8 npicomx.vinnymac.dev
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849-- core: engine entry + pause-menu skin picker
function _init() poke(0x5f2d,0) cartdata("npicomx_v1") timed=false saved=0 purged=0 playt=0 bf_skin=dget(5) if dget(4)>0 or dget(3)>=3 then menuitem(1,skin_label(),tog_skin) end menuitem(2,"main menu",to_menu) -- straight to the title menu menuitem(3,"credits",show_credits) init_splash()end
function _update() if dbg then -- headless auto-tour, INLINE so `--const dbg false` strips it from ship builds dbgt+=1 local s=flr(dbgt/45) if s==1 then scr=1 elseif s==2 then if scr!=2 then init_play() end elseif s==4 then scr=4 wt=130 end if dbgt%45==30 then extcmd("screenshot") end if dbgt>250 then extcmd("shutdown") end end if scr==0 then update_splash() elseif scr==1 then update_menu() elseif scr==2 then update_play() elseif scr==3 then update_over() else update_win() endend
function _draw() if scr==0 then draw_splash() elseif scr==1 then draw_menu() elseif scr==2 then draw_play() elseif scr==3 then draw_over() else draw_win() endend
function tog_skin(b) local mx=dget(4)>0 and (dget(3)>=3 and 3 or 2) or 0 if mx>0 then bf_skin=(bf_skin+(b&1>0 and mx or 1))%(mx+1) dset(5,bf_skin) sfx(0) end menuitem(nil,skin_label()) return trueend
function skin_label() return "skin: "..sk_names[bf_skin+1] end