Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grainboy

Make and play games with Grain 🌾

Overview

This is a Rust app that uses winit for windowing, wgpu for cross-platform graphics rendering, and wasmtime for running wasm game code.

Quick Start

1. Build the game

# will hot-reload the game if it's already running
rm *.wasm && grain compile --no-wasm-tail-call hello.gr

2. Start the app

cargo run

3. Run the game

Drag hello.gr.wasm onto the window and play! 🎮

Development

  • windowing: src/lib.rs
  • graphics rendering: src/gpu.rs
  • user input structs:src/input.rs
  • wasm runtime: src/wasm.rs
  • spritesheet: src/spritesheet.
  • shader: src/main.wgsl.
  • grainboy bindings: grainboy.gr
  • demo game: hello.gr

To start the app, exec cargo run.

Troubleshooting

If you see a message like

Failed to load dropped file: unknown import: `GRAIN$MODULE$runtime/gc::malloc` has not been defined

you may have dragged grainboy.gr.wasm onto the window instead of your entrypoint.

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

4 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages