Log In  

Hi!

I'm just starting out with pico8. can I somehow split my code into several files? So that I can easily re-use certain functions, or libraries like https://github.com/clowerweb/Lib-Pico8/

How would I import them (putting them into lib/file.lua then import "lib/file.lua" does not seem to work – it doesn't expose the defined functions.

P#42639 2017-07-20 06:28 ( Edited 2017-07-20 11:31)

There is no import. If you want to split stuff up into seperate files you'll have to write our own tool to stitch things together.

P#42641 2017-07-20 07:03 ( Edited 2017-07-20 11:03)

I see. What's the usual approach to handling large-ish files? scrolling in this tiny viewport feels really weird. :D

P#42643 2017-07-20 07:26 ( Edited 2017-07-20 11:26)

Edit the file from the outside, save it and Control-R your cart from Pico8. Pico will see the file has changed, reload it and run it.

Some people (including me) have probably more (or less) working solutions around file assembling as you describe, but AFAIK nobody has published its solution. Mine is not completely working and is not yet ready for prime time ;)

P#42644 2017-07-20 07:31 ( Edited 2017-07-20 11:31)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-16 10:55:29 | 0.009s | Q:19