Object passable/opaque: editor checkboxes + doc/simplify cleanup

- ObjectDef gains passable/opaque fields (defaults: false/true); Board::is_passable
  consults the object before the grid cell, so objects block movement independently
  of the floor tile beneath them
- Editor Objects tab exposes Passable and Opaque checkboxes; changes survive save/load
- Add ObjectDef::new(x, y) to centralise placement defaults; remove triple
  default_glyph() call and unused Glyph import from main.rs
- Fix stale Behavior doc comment; update CLAUDE.md and ARCHITECTURE.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 21:48:40 -05:00
parent 0241cd2a8d
commit 067bb9bee0
4 changed files with 43 additions and 27 deletions
+2 -13
View File
@@ -10,7 +10,7 @@ mod render;
use editor::{EditorState, EditorTab, show_editor_panel};
use font::BitmapFont;
use kiln_core::game::{FontSpec, GameState, Glyph, ObjectDef};
use kiln_core::game::{FontSpec, GameState, ObjectDef};
use kiln_core::map_file;
use render::{
DEFAULT_WINDOW_H, DEFAULT_WINDOW_W, MIN_WINDOW_H, MIN_WINDOW_W, board_origin, draw_board,
@@ -237,18 +237,7 @@ impl eframe::App for App {
if self.editor.placing_object {
// Placement mode: create a new object here if none exists.
if board.object_index_at(cx, cy).is_none() {
board.objects.push(ObjectDef {
x: cx,
y: cy,
glyph: Glyph {
tile: ObjectDef::default_glyph().tile,
fg: ObjectDef::default_glyph().fg,
bg: ObjectDef::default_glyph().bg,
},
passable: false,
opaque: true,
script_name: None,
});
board.objects.push(ObjectDef::new(cx, cy));
}
self.editor.placing_object = false;
} else {