Skip to main content

Module project

Module project 

Source
Expand description

On-disk project layout used while developing a cart.

A Pixel8 project is a real Cargo crate plus an asset bundle:

mygame/
  Cargo.toml      # generated by `new`, builds a cdylib for wasm32
  src/lib.rs      # the game code edited inside Pixel8 (or outside!)
  assets.pixel8.json  # sprites/map/sfx/music/metadata (JSON, versioned)
  target/         # cargo build output

Keeping the project a normal crate is what makes the external-editor workflow work: cargo build --target wasm32-unknown-unknown from a terminal produces exactly what the in-console run uses.

Structs§

Project
A loaded project: code + assets + where they live.

Constants§

TEMPLATE_CODE
Default game source created by new.

Functions§

decode_assets
Parse an assets file, checking the format version.
encode_assets
Serialize assets as versioned, human-readable JSON.