Just released a new feature for my VSCode plugin PICO-8 LS: Code formatting! (Link to install VSCode extension)
IMO it's most useful for making minified code from e.g. a tweetcart more readable. Example:
(The code snippet above is the excellent TweetTweetJam entry XTRIS, by Fletch: https://fletchmakesstuff.itch.io/xtris)
Note that it's accessible in multiple ways:
- The regular
Format Document
command in VSCode (alt+shift+F is the default keyboard shortcut) Command Palette
->PICO-8 LS: Format File
for regular code formattingCommand Palette
->PICO-8 LS: Format File: Each Statement on Separate Line
which will put each statement on a separate line. (By default, the formatter lets multiple statements be on the same line, preserving your cart structure.) This is the command used in the GIF above.
Please be careful when using this tool, and save a backup of your cart before formatting it! Since this is the first time it's being released, there may still be issues to work through.
I've always been frustrated by how low-tech the dev environment feels for PICO-8, so I finally decided to do something about it. Introducing:
PICO-8 Language Server for VSCode
pico8-ls is a full-featured language extension for VSCode. It gives the full IDE experience, as if you were developing with Javascript, Java, Python, C#, etc.
Download here: pico8-ls - VSCode Marketplace
This extension has full support for the PICO-8 dialect of Lua - which means you don't have to move your code into a .lua file, or go through and remove all the += to get the Lua extension to work!
Here are some other useful features:
- Go to definition
- Find references
- Warning on undefined variable usage
- Get documentation for built-in functions by hovering over them
- Support for "#include"ing other files
Demo of hover-docs, auto-complete, and signature help:
Stranded on Saturn - a demake of Commander Keen 1-3. Pogo your way through 4 huge levels to find the Bean With Bacon Megarocket and escape back to Earth!
Controls:
(o) or z - jump
(x) or x - get out/put away pogo stick
Hold jump while pogoing to go a lot higher!
Collect lollipops, sodas, and Vorticon teddy bears for an extra challenge. These are totally optional and just serve as an extra objective for those that are interested (much like the strawberries in Celeste).