Log In  

So... since I'm copying a number of .p8.png files to my Picade for on-the-go play, I was going to try and edit the code in them so they contain a software exit... simply put, "start + select" will issue the shutdown console command. Is this something we can do within the game? Like simply...

if (btn(7) is true and btn(8) is true) shutdown()

...or is it messier than that?

P#31487 2016-10-22 18:54 ( Edited 2016-10-23 11:56)

Tony, you have the advantage that you're not working with my code. (I hope I said that correctly). :)

By this I mean you have normal coded games use the function _Update(). In this, you could easily check for these two buttons and then issue the command shutdown() or stop().

However, for my games and stuff, you can always insert your shutdown checking code in-between the function nano() which I often use to read the keyboard and in some cases, update the screen.

P#31489 2016-10-22 19:06 ( Edited 2016-10-22 23:08)

there's no button you can poll beyond 5. though you could add a 'shutdown' option via menuitem(). problem is, shutdown() & exit() don't work from within code since 0.1.8, for some reason.

I guess your best bet for now would be to start in splore mode ?

having 'shutdown' in the pause menu is a feature that has been asked for numerous times on this board...

P#31493 2016-10-22 20:02 ( Edited 2016-10-23 00:02)

Well you can still shutdown PICO-8 using atan2(1,32768) as of 0.1.9b :-)

P#31531 2016-10-23 06:29 ( Edited 2016-10-23 10:29)

lol! here's a oneliner then:

function exit_cb()atan2(1,32768)end menuitem(1,'exit',exit_cb)

(spawns an annoying box on windows though) :)

P#31535 2016-10-23 07:56 ( Edited 2016-10-23 11:57)

[Please log in to post a comment]