You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -377,6 +377,10 @@ Releases include **basic-gfx** — a full graphical version of the interpreter b
377
377
- Use `SCREENCODES OFF` to restore the default (ASCII strings like `PRINT "HELLO"` map naturally).
378
378
- The window closes automatically when the program reaches `END`.
379
379
380
+
**Viewport scroll (basic-gfx + canvas WASM)**:
381
+
382
+
-**`SCROLL dx, dy`** sets a **pixel** offset for the **text/bitmap layer and sprites** (positive **dx** pans the world to the left; positive **dy** pans up). Use **`SCROLL 0, 0`** to reset. **`SCROLLX()`** / **`SCROLLY()`** return the current offset (roughly **-32768..32767**). Tutorial: `examples/tutorial_gfx_scroll.bas`.
383
+
380
384
**PNG sprites / HUD overlay (basic-gfx)**:
381
385
382
386
-`LOADSPRITE slot, "file.png"` queues loading a PNG from disk. Paths are relative to the **`.bas` file’s directory** (or absolute). Only `.png` is supported here; use `LOAD "bin" INTO …` for raw bytes.
@@ -405,6 +409,7 @@ Releases include **basic-gfx** — a full graphical version of the interpreter b
405
409
406
410
The `examples` folder (included in release archives) contains:
407
411
412
+
-**Graphics / WASM feature tours** (run with **`./basic-gfx`** or load into **`web/canvas.html`**): `tutorial_gfx_index.bas` lists short demos — **`tutorial_gfx_scroll.bas`** (**`SCROLL`**), **`tutorial_gfx_memory.bas`** (**`POKE`/`PEEK`** bases), **`tutorial_gfx_tilemap.bas`** (**tile****`LOADSPRITE`** + **`tutorial_tile_sheet_demo.png`**), **`tutorial_gfx_gamepad.bas`** (**`JOY`**/**`JOYAXIS`**). See also **`web/tutorial-gfx-features.html`** for a static overview (serve the `web/` directory over HTTP).
408
413
-`dartmouth.bas`: classic Dartmouth BASIC tutorial; exercises `PRINT`, `INPUT`, `IF`, `FOR/NEXT`, `DEF FN`, `READ`/`DATA`, and more.
409
414
-`trek.bas`: Star Trek–style game; exercises `GET`, `ON GOTO`/`GOSUB`, multi-dimensional arrays, and PETSCII-style output.
410
415
-`chr.bas`: PETSCII/ANSI color and control-code test (run with `-petscii`).
Copy file name to clipboardExpand all lines: docs/sprite-features-plan.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Sprite Features – Planning & Specification
2
2
3
-
**Status**: **Partially implemented** in `basic-gfx` + canvas WASM: `LOADSPRITE`, optional **tile sheet**`LOADSPRITE slot, "sheet.png", tw, th`, `DRAWSPRITETILE`, `SPRITETILES`, **`SPRITEFRAME`** (default tile for `DRAWSPRITE` without crop), `UNLOADSPRITE`, `DRAWSPRITE` (persistent pose per slot, `z` and optional source rectangle), `SPRITEVISIBLE`, `SPRITEW`/`SPRITEH`, `SPRITECOLLIDE`. **Worked example**: `examples/gfx_game_shell.bas` (PETSCII tile map via `POKE` + PNG player/enemy/HUD); **minimal HUD demo**: `examples/gfx_sprite_hud_demo.bas`. **Gamepad**: `JOY`/`JOYAXIS` in **basic-gfx** and **canvas WASM** (`examples/gfx_joy_demo.bas`). Full **world tilemap engine** (scroll, layers) still planning.
3
+
**Status**: **Partially implemented** in `basic-gfx` + canvas WASM: `LOADSPRITE`, optional **tile sheet**`LOADSPRITE slot, "sheet.png", tw, th`, `DRAWSPRITETILE`, `SPRITETILES`, **`SPRITEFRAME`** (default tile for `DRAWSPRITE` without crop), `UNLOADSPRITE`, `DRAWSPRITE` (persistent pose per slot, `z` and optional source rectangle), `SPRITEVISIBLE`, `SPRITEW`/`SPRITEH`, `SPRITECOLLIDE`. **Worked example**: `examples/gfx_game_shell.bas` (PETSCII tile map via `POKE` + PNG player/enemy/HUD); **minimal HUD demo**: `examples/gfx_sprite_hud_demo.bas`. **Gamepad**: `JOY`/`JOYAXIS` in **basic-gfx** and **canvas WASM** (`examples/gfx_joy_demo.bas`). Full **world tilemap engine** (layers beyond a single viewport) still planning. **Viewport****`SCROLL dx, dy`** + **`SCROLLX()`/`SCROLLY()`** implement shared camera-style pan for text/bitmap/sprites (see **`examples/tutorial_gfx_scroll.bas`**).
4
4
5
5
This document outlines a sprite subsystem for `basic-gfx`, designed for modern hardware with no C64-style limits. The goal is to let BASIC programs load PNG images as sprites, draw them at arbitrary positions with depth ordering, and perform collision detection.
0 commit comments