fix(client): address PR review — input bug, bounds checks, fixture tests
- Fix input_mapper double-check bug (redundant InputEventKey + pressed filter) - Add bounds checking for position arrays in entity_renderer and game_state - Make test snapshot deterministic (incrementing counter, not wall clock) - Fix tween overlap in monologue_display (cancel active tween before new one) - Extract TILE_SIZE constant from magic number 32 - Add 5 D-030 Layer 1 fixture tests for snapshot parsing (7/7 total passing) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,8 @@ extends Node2D
|
||||
# Entity renderer — manages entity sprites under the Entities node
|
||||
# Creates/updates/removes Sprite2D children based on entity data
|
||||
|
||||
const TILE_SIZE: int = 32
|
||||
|
||||
var entity_nodes: Dictionary = {} # id -> Node2D mapping
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -63,7 +65,10 @@ func _update_entity_node(entity_id: int, entity_data: Dictionary) -> void:
|
||||
# Update position
|
||||
if entity_data.has("position"):
|
||||
var pos = entity_data.position
|
||||
entity_node.position = Vector2(pos[0] * 32, pos[1] * 32) # 32px grid
|
||||
if pos is Array and pos.size() >= 2:
|
||||
entity_node.position = Vector2(pos[0] * TILE_SIZE, pos[1] * TILE_SIZE)
|
||||
else:
|
||||
push_warning("EntityRenderer: malformed position for entity %s" % entity_id)
|
||||
|
||||
# Remove an entity node
|
||||
func _remove_entity_node(entity_id: int) -> void:
|
||||
|
||||
Reference in New Issue
Block a user