feat: add 30x20 demo map and chest interaction

This commit is contained in:
goose
2026-10-01 22:28:23 -04:00
parent b5eaf0ef4f
commit 67efd9dc67
27 changed files with 307 additions and 90 deletions
+17
View File
@@ -0,0 +1,17 @@
extends GutTest
const GameScene = preload("res://scenes/Game.tscn")
func test_initial_demo_map_is_30_by_20_with_a_known_door_chest_and_stairs_route() -> void:
var game := GameScene.instantiate() as Game
add_child_autofree(game)
await get_tree().process_frame
var state := game.get_game_state()
assert_eq(state.map.size, Vector2i(30, 20))
assert_eq(state.player.cell, Vector2i(4, 12))
assert_eq(state.map.get_cell(Vector2i(4, 11)), GridMapState.CellKind.CLOSED_DOOR)
assert_eq(state.map.get_cell(Vector2i(4, 7)), GridMapState.CellKind.CHEST)
assert_eq(state.map.get_cell(Vector2i(18, 4)), GridMapState.CellKind.STAIRS)
for cell in [Vector2i(4, 10), Vector2i(4, 8), Vector2i(4, 6), Vector2i(10, 4), Vector2i(17, 4)]:
assert_true(state.map.is_walkable(cell), "Expected the demo route to include %s." % cell)