Home

Awesome

Lumina

A retro 8BIT Fantasy Console mode by Artium!

Games for Lumina can be written in simple JavaScript code. Lumina games run in the browser of any PC or mobile device.

How to make a game with Lumina

Setup

Download lumina.js, and add this tag to your HTML:

    <script src="../src/lumina.js"></script>

init() and update()

function init() {
    // Put your code here and it will be called only on the first frame
}

function update() {
    // Put your code here and it will be called 60 times per second (60fps)
}

Colors and modes

Lumina uses a 16-color pallet as below:

pico-8-32x

Lumina also supports 3 display modes (from left to right are mode 0, mode 1, mode 2):

mode0 mode1 mode2

Functions

mode(x) → Set display mode for Lumina, which has 3 modes:

And by default, Lumina uses mode 1 instead of the 2 others

btn(x) → Will return value true or false if the button with id x is pressed or not

pset(x, y, [col]) → Set the pixel at point x, y to the color col

text(text, x, y, [col]) → Print text at point x, y with the color col

line(x1, y1, x2, y2, [col]) → Draw line from point x1, y1 to point x2, y2 with the color col

circ(x, y, radius, [col]) → Draw a circle outline at point x, y with radius radius and with the color col

circfill(x, y, radius, [col]) → Fill a circle at point x, y with radius radius and with the color col

rect(x1, y1, x2, y2, [col]) → Draw a rectangle outline at from point x1, y1 to point x2, y2 with the color col

rectfill(x1, y1, x2, y2, [col]) → Fill a rectangle at from point x1, y1 to point x2, y2 with the color col

sound(frequency, duration) → Play a noise with frequency (hz) with duration (ms)