DESCRIBE A GAME IN V
AND GET 68000 MACHINE CODE
WITHOUT WRITING ONE INSTRUCTION
jaggame goes a step further than jagkit and takes the assembly away too. A program describes itself (variables, logic, sprites, rooms, scenes, sound) to a builder. The builder checks it, compiles the logic to 68000 code, links it with a fixed runtime and writes a .jag image, plus a .j64 cartridge image for a board with the save chip.
It builds and runs: v run it, then just run ball.jag.
mut g := jaggame.new_game(jaggame.Config{ sprites: 1, layers: 1 }) g.art_cry('ball', 16, 16, 1, []u16{len: 256, init: jaggame.cry(255, 160, 40)}) ball := g.sprite(0) hud := g.text_layer('hud', jaggame.TextConfig{ columns: 16, rows: 1, x: 8, y: 8 }) steps := g.p.u16('steps') mut init := g.define_init() ball.put(mut init, 'ball', 152, 112, 0) hud.print(mut init, 0, 0, 'STEPS') mut c := g.define_update() c.if_(g.held(.left)) c.sub_from(ball.x, 2) c.inc(steps) c.end() c.if_(g.held(.right)) c.add_to(ball.x, 2) c.inc(steps) c.end() hud.number(mut c, 6, 0, steps, 5) os.write_file_array('ball.jag', g.build()!.bytes)!
| PART | WHAT IS IN IT |
|---|---|
| A small typed language | u8 to u32, fix (16.16), bool, arrays, tables, records, functions, state machines. Types, sizes and memory are checked when the image is built; every mistake comes out together, with its place. |
| A runtime | A frame loop for NTSC and PAL, sprites, text layers, timers, tile rooms bigger than the screen with a camera and collision, line of sight and hearing, scenes with a fade between them, menus. |
| Sound | A six-voice DSP synthesizer with effects and music written as text patterns. |
| Saves | A saved record in the cartridge's EEPROM. |
| A GPU backdrop | A drifting neon grid with a sweeping bar and a scrolling gradient, as the first object of the display list. |
| Assets | PNG files to sprites, tile sets and palettes; rooms as text with a legend. |
| Tested twice | A differential fuzzer runs random programs in the interpreter and on the emulated 68000. A robot plays GHOSTGRID through the pad. |
![]() |
A stealth trainer with ten missions, written on jaggame with no assembly in it. Guards with a state machine (patrol, suspicious, alert, search, return) throw a cone of amber light on the floor that walls cut, and the cone is exactly what sees you. Cameras sweep cones of their own and call the guards. The interpreter plays whole missions alongside the machine and the two agree frame by frame. |
| READ | FOR |
|---|---|
| docs/jaggame/guide.md | the guide, from the language to GHOSTGRID's missions |
| docs/jaggame/reference.md | every public name, generated from the source comments |
| jaggame/README.md | what it is, in twenty lines of code |
v -prod test jaggame/ demos/hello2/ demos/ghostgrid/ # all of it, about four minutes