Hi,
I'm writing to announce tspico8, a project which allows you to create PICO-8 games using TypeScript. For anyone unfamiliar with TypeScript, it's a superset of JavaScript, and it allows you to annotate your code with static type declarations so that the compiler can find a lot of errors for you.
Some of the benefits include:
- Write PICO-8 games in a powerful language with a lot of builtin safety
- Take advantage of tooling to improve code quality (linting, formatting, etc)
- Minify code automatically to reduce token size (multiple configuration options)
- Utilize an external spritesheet if you want to (make sprites with aseprite, etc)
For anyone that's curious, the technical details of how this works are as follows:
- TypeScript is compiled to JavaScript
- JavaScript is minified (compressed and mangled)
- Minified JavaScript is transpiled to PICO-8 compatible Lua
- Everything is packaged into a cart (code & spritesheet)
PICO-8 reloads automatically on every build to save you time.
Check out the project if you're interested, and let me know what you think. Thanks!
looks like a really awesome project! I got it up & running today on WSL2 Ubuntu. For Prerequisite #5 I had to do this:
PATH=$(npm bin):$PATH
Not sure if thats right but it works great. PATH reverts back after I exit Ubuntu.
I compiled the typescript cart provided and could see the recompilation trigger properly when I make edits. Only thing not working out of the box for me is auto-launching the cart - probably because I’m on WSL2 and it is choosing linux pico8. I just copy & paste around this for now.
I had some fun noticing I hadn’t updated nodejs since v10 haha! I thought updating might help me build this other TS project I was trying to work on — but anyway that one still has issues for me. It has like hundreds of Subsequent Property Declaration Errors TS2717. I’ll save that for another day.
Thanks for posting
Glad you liked it! I'll take a look at your comment regarding prereq #5. Thanks for the feedback!
[Please log in to post a comment]