GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - notnullgames/cart_rust: A null0 cart template for Rust - press 'Use this template' to start a game

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
cart
cart
 
 
webroot
webroot
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
package.json
package.json
 
 

Repository files navigation

mygame

A starter null0 cart, in Rust.

Press Use this template to make your own, then search the project for mygame and rename it to whatever your game is called.

building

Everything is built inside docker, so you never install cargo, wasm32-unknown-unknown yourself. All you need is docker, plus node for the shortcuts below.

npm start

That builds webroot/mygame.null0, serves webroot/, and rebuilds whenever you edit something in cart/. To build once, without the server:

npm run build

Or call docker yourself:

rm -f webroot/mygame.null0
docker run --rm --user $(id -u):$(id -g) -v ./cart:/src -v ./webroot:/out ghcr.io/notnullgames/null0-cart-rust:latest mygame

writing your game

Your code is in cart/src/lib.rs. A cart implements the callbacks it cares about and the host skips the rest:

#[no_mangle] pub extern "C" fn load() {}

Rust notes

  • no_std, crate-type = ["cdylib"], panic = "abort".
  • The declarations live in an extern "C" block, so every call is unsafe.

You do not need to copy any null0 bindings into this project - the docker image bakes the current carts/rust/src/lib.rs in for you.

docs

  • Rust carts - the whole API, in Rust
  • Anatomy of a cart - callbacks, input, distribution
  • API reference

publishing

Two workflows come with this template:

  • Publish builds the cart and deploys webroot/ to github-pages on every push to main, so anyone can play your game in a browser without installing anything.
  • Release attaches mygame.null0 to any github release you create.

Players who want it natively can grab the runtime and run null0 mygame.null0.

About

A null0 cart template for Rust - press 'Use this template' to start a game

notnull.games/null0/languages/rust

Topics

cartnull0null0-rust

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.