19 lines
773 B
GDScript
19 lines
773 B
GDScript
extends GutTest
|
|
|
|
const GameScene = preload("res://scenes/Game.tscn")
|
|
|
|
func test_initial_level_is_the_reference_surface_not_the_old_demo_map() -> 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(42, 16))
|
|
assert_eq(state.player.cell, Vector2i(4, 7))
|
|
assert_eq(state.map.get_cell(Vector2i(36, 7)), GridMapState.CellKind.CLOSED_DOOR)
|
|
assert_eq(state.map.get_cell(Vector2i(39, 7)), GridMapState.CellKind.STAIRS)
|
|
assert_eq(state.floor_state.floor_number, 0)
|
|
assert_true(state.floor_state.chests.is_empty())
|
|
for x in range(4, 36):
|
|
assert_true(state.map.is_walkable(Vector2i(x, 7)), "Expected the surface corridor to include (%d, 7)." % x)
|