Getting Started
Using the browser IDE
The fastest way to try Shrimp is the online IDE at polarbeardomestication.net/shrimp.
- Open the IDE
- Write your code in the editor (or pick a demo from the ๐ฆ Demos menu)
- Click โถ Run
- Your game compiles and runs instantly in the emulator
Controls
| Key | Game Boy |
|---|---|
| Arrow keys | D-pad |
Z | A button |
X | B button |
Enter | Start |
Shift | Select |
Using the CLI
You can also compile Shrimp programs from the command line.
Build the compiler
cargo build -p compiler --release
Compile a program
./target/release/shrimp games/pong.s -o games/pong.gb
Run it
Load the .gb file in any Game Boy emulator, or use the built-in web emulator.
Program structure
Every Shrimp program follows this structure:
from core import pressed, set_sprite, Button
tile my_tile:
........
.333333.
.3....3.
.3....3.
.3....3.
.3....3.
.333333.
........
let x = 80
let y = 72
init:
set_sprite(0, x, y, my_tile)
on vblank:
# game logic runs here, ~60 times per second
set_sprite(0, x, y, my_tile)
Key sections
- Imports โ bring in built-in functions from
core - Tiles โ define 8ร8 pixel art inline
- Constants โ compile-time values with
const NAME = value - Global variables โ state that persists across frames
init:โ runs once at startupon vblank:โ runs every frame (~59.7 fps)