Crates.io | pikuseru |
lib.rs | pikuseru |
version | 0.1.1 |
source | src |
created_at | 2023-02-20 11:10:32.752619 |
updated_at | 2023-02-20 12:11:26.498313 |
description | Pikuseru Console |
homepage | https://github.com/PikuseruConsole/pikuseru |
repository | https://github.com/PikuseruConsole/pikuseru.git |
max_upload_size | |
id | 789751 |
size | 749,427 |
Pikuseru Console (previously known as PX8 or Unicorn Console) is a fantasy engine that let you do quickly any sort of game, application with a default resolution of 128x128 pixels, 32bits color. The console allow you to load what is called a 'cartridge' that looks like a text file, that contains the code, the graphics and the sounds.
The main engine is not dependant of a specific graphic library so you can use it where you want:
See the console for more examples.
The console is somewhat compatible with pico-8 (buy it !), most of current functions from pico8 is implemented and the cartridge is the same format. However some pico8/lua language syntax is supported like:
But see the pikuseru-examples, I did some modifications of good games to use it with Pikuseru too.
Cargo feature:
You can build the console directly the main UI to play games:
cd pikuseru
cargo build --release --features=cpython,rlua,image
File format | Read | Write |
---|---|---|
Pico8 .PNG | X | / |
Pico8 .P8 | X | X |
Pikuseru (.PIK) | X | X |
Pikuseru file format is exactly the same as PICO8 P8 format, except that new sections are available, like python, rhai, wasm, code etc.
The API is available for Lua/Python.
camera([x, y])
Set the camera position.
circ(x, y, r, [col])
Draw a circle:
circfill(x, y, r, [col])
Draw a filled circle:
clip([x, y, w, h])
Set a screen clipping region where:
Clear the screen.
color(col)
set default color
ellipse(x, y, rx, ry, [col])
Draw an ellipse
ellipsefill(x, y, rx, ry, [col])
draw filled ellipse
fget(n, [f])
get values of sprite flags
font(name)
Change the font policy ("pico8", "bbc", "cbmII", "appleII")
fset(n, [f], v)
set values of sprite flags
line(x0, y0, x1, y1, [col])
draw line
pal(c0, c1)
Switch the color c0 to color c1.
palt(col, t)
Set the transparency for color 'col', where 't' is a boolean
pget(x, y)
Get the pixel color in x/y coordinate
print (str, [x, y, [col]])
Display a string on the screen
pset(x, y, col)
Set the pixel color with the value 'col' in x/y coordinate
rect(x0, y0, x1, y1, [col])
draw a rectangle
rectfill(x0, y0, x1, y1, [col])
draw filled rectangle
sget(x, y)
get spritesheet pixel colour
spr(n, x, y, [w, h], [flip_x], [flip_y])
Draw a sprite:
Color 0 will be transparent by default (see "palt" API).
sset(x, y, [col])
set spritesheet pixel colour
sspr(sx, sy, sw, sh, dx, dy, [dw, dh], [flip_x], [flip_y])
draw texture from spritesheet
trigon(x1, y1, x2, y2, x3, y3, [col])
draw trigon
get button i state for player p
only true when the button was not pressed the last frame; repeats every 4 frames after button held for 15 frames
map(cel_x, cel_y, sx, sy, cel_w, cel_h, [layer])
[Python: spr_map]
Draw map; layers from flags; sprite 0 is empty
mget(x, y)
Get a map value
mset(x, y, v)
Set a map value