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>
This commit is contained in:
+3
-3
@@ -110,9 +110,9 @@ impl eframe::App for App {
|
||||
);
|
||||
});
|
||||
|
||||
// Force a repaint every frame so input is processed continuously.
|
||||
// Remove this if the game becomes purely event-driven.
|
||||
ctx.request_repaint();
|
||||
// egui repaints automatically on input events, so no explicit
|
||||
// request_repaint() is needed while the game is purely event-driven.
|
||||
// Add it back (or call it from game logic) when continuous animation is needed.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user