All Projects → YellowAfterlife → Hxpico8

YellowAfterlife / Hxpico8

Licence: mit
Experimental Lua target for Haxe

Programming Languages

haxe
709 projects

What's this

This is an experimental Haxe compiler target for pico-8.

It's primary purpose is generating laconic Lua code that can be compared to handwritten code while still retaining support for most Haxe' features.

It can also be viewed as an example of how JS Generator API can be used to quickly prototype new language targets.

What's pico-8

Pico-8 is a "fantasy console". It has a number of strict restrictions and is interesting to experiment with.

It also has it's own flavour of Lua scriptting language, which gets us here.

If you have bought the "Humble Mozilla Bundle" some time ago, you should already own it together with Voxatron.

How to use this

  1. Setup this repository as a haxelib (see haxelib git)
  2. Download and install Haxe 3.2.
  3. Setup your project to use the library. This is done by adding the following into your HXML file (or Project Properties - Compiler Options - Additional Compiler Options in FlashDevelop):
-lib hxpico8
--macro p8gen.PgMain.use()
-dce full

The project should be pointed generate either a .lua file, or to a .p8xm (which will update a .p8 of the same name with new code section).

You'll most likely want to use the Pico class, which maps the built-in functions of the console. Since Pico-8 does not include the standard Lua function set, very little of standard Haxe API is supported.

For additional examples, see the hxpico8 example repository.

About

hxpico8 is made by Vadim "YellowAfterlife" Dyachenko. MIT license.

You can find me on Twitter / Tumblr / VK if you want to.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].