0.4.0 • Published 4 years ago

jspicl-cli v0.4.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

jspicl CLI

jspicl CLI is a command line tool that simplifies PICO-8 game development in JavaScript.

Features:

  • Comes with its own set of build pipeline so you don't need one.
  • JavaScript to PICO-8 Lua transpilation through jspicl.
  • Treeshaking which prevents unused code from being included and increasing your token count.
  • Allows a PNG file to be used as a spritesheet, no need to edit your assets in PICO-8 anymore. Use your image editor of choice.
  • Live reloading of PICO-8 cartridge whenever code or spritesheet is updated. See your changes live!

Future goals:

  • Importing audio files to be used as SFX or music.

Installation

npm install jspicl-cli -D

Usage

In order to generate a cartridge you need to supply at least four mandatory options:

jspicl-cli
  --input <entryfile.js>
  --output <outputFile.p8>
  --spritesheetImagePath <pathToSpriteSheetFile.png>
  --cartridgePath <pathToExistingCartridge.p8>

Options

NameTypeDescription
inputstringYour game's entry point. This file can then import other modules. [required]
outputstringWhere to output the PICO-8 cardridge [required]
spritesheetImagePathstringPath to a spritesheet file. Only PNGs are supported. [required]
cartridgePathstringPath to an existing cardridge to reuse sound, music and state flags from. Normally you would point this to the generated cartridge so that you can save the assets directly and reuse them. [required].
includeBannerbooleanInclude a short comment at the very top of the generated LUA code that contains info about jspicl. Does not affect token count.
jsOutputstringWhere to output the flattened and transpiled JavaScript code. You may use this with astexplorer to inspect the AST, just make sure to select Esprima as the parser. For debugging purposes.
luaOutputstringWhere to output the transpiled LUA code. For debugging purposes.
showStatsbooleanDisplay statistics about the generated cartridge. Useful for determining how much resources your game is using.
pipeOutputToConsolebooleanOutput all console.log to terminal that launched PICO-8. For debugging purposes.
reloadOnSavebooleanReload PICO-8 when the cartridge has been updated.
customPicoPathstringCustom path to the PICO-8 executable.
prettifybooleanFormat the generated LUA code.
watchRuns the cartridge in PICO-8 and rebuilds it when the source files change.

Watch mode

The CLI will listen for changes when the --watch option is passed.

npm.io

This applies for the spritesheet aswell. Simply save your image and your changes will be reloaded in PICO-8.

npm.io

NOTE: Reloading the cartridge is currently only supported on MacOS.

Other jspicl related projects