Commit Graph

9 Commits

Author SHA1 Message Date
randrews ac6a8dec57 Replace Element with Behavior + Archetype; update map format
Element is replaced by two types: Behavior (a plain struct of runtime
properties: passable, opaque) and Archetype (an enum of named presets:
Empty, Wall, Object, ErrorBlock). Board.cells changes from Vec<(Glyph,
usize)> to Vec<(Glyph, Archetype)>, eliminating the per-board element
palette. Map files now reference archetypes by name (archetype = "wall")
instead of property bags (passable = false), so the archetype list can
be reordered without breaking saved games. Unknown archetype names
produce an ErrorBlock cell (yellow ? on red) so malformed maps are
immediately visible in-game.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 15:20:46 -05:00
randrews 453c7baf4e Add rustdoc and inline comments throughout; update CLAUDE.md style guide
All public types, fields, and functions in game.rs and map_file.rs now
have /// doc comments. main.rs has /// on App and draw_glyph plus inline
comments explaining the input/render pipeline. CLAUDE.md records the
expectation that generated code includes comments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 12:48:52 -05:00
randrews 176c70de6b Add future considerations section to ARCHITECTURE.md
Documents the player-as-object goal and calls out the four specific
places in the current design (Board.player, player_start, try_move,
main.rs overlay) that will need to change when that's implemented.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 12:10:21 -05:00
randrews 9f62bba80c Add ARCHITECTURE.md with design rationale and context
Documents the module structure, key design decisions and their reasons,
map file format design, what's not yet implemented, and ZZT background
for future development sessions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 11:50:42 -05:00
randrews 573e662799 Update CLAUDE.md with current architecture
Documents all implemented modules, data structures, map file format,
and key design decisions made during this session.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 01:51:57 -05:00
randrews 2dc749e037 Load maps from TOML files with XPM-style palette
Introduces a map file format: TOML with a [palette] mapping characters
to (Glyph, Element) definitions and a [grid] multi-line string. Board
now owns the player position, objects, and portals. map_file::load()
deserializes a file and converts it to a Board via From<MapFile>.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 01:50:05 -05:00
randrews 37c10c7c38 Size window to fit board including panel margin; center board on resize
Accounts for egui's 8px CentralPanel margin in the minimum window size.
When the window is larger than the minimum, the board is centered in the
available area.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 01:18:02 -05:00
randrews f7e585f6ed Add basic player movement on a ZZT-style board
Implements Glyph (per-cell visual), Element (shared behavior palette),
and Board (60x25 grid of (Glyph, usize) cells). Player walks around
with arrow keys and is blocked by wall elements.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 01:10:04 -05:00
randrews f3e5dece7f Initial project scaffold
Sets up eframe/egui app with basic menu bar and placeholder viewport. Adds Rhai scripting dependency for future game object scripting system.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 23:42:14 -05:00