Pico8 has a function time() that when called displays the current time from start of program.
i.e. print(time(),0,0,14) --prints time at (0,0) with colour 14
However the function doesn't stop and keeps drawing the time each frame. I'm trying to figure out how I would draw the time without it increasing/changing. So If I printed this 5 seconds from the start of the program I'd want it to display 5, but not change from that 5 value.
https://pico-8.fandom.com/wiki/Time I don't know how to store a static value of this time as a variable. Although according to the wiki, assigning var=time() will cause time at 0 to be stored.
Another way of phrasing this is...how would I display the time of 10 seconds when the following print is triggered? So after 10 seconds "time's up" is displayed. How would I display the current time 10, as well, as a static? Maybe I don't know what the time is when the event is triggered, so how can I count using time()?
function _init() last = time() end function _update() -- (empty update to use game loop) end function _draw() cls() if (time() - last) > 10 then print("time's up!", 44, 60, 7) end end