Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions hoppys-adventure-arcade/tests/enchanted_repo_smoke.gd
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,20 @@ func place(pos: Vector2) -> void:
func release() -> void:
for action in ["jump","move_right","move_left","attack"]: Input.action_release(action)

func spawned_on_floor() -> bool:
var scene := current_scene
return scene!=null and scene.get("player")!=null and scene.player.is_on_floor()

func run() -> void:
change_scene_to_file("res://scenes/platformer/enchanted_repo.tscn")
await frames(12)
# Engine start-up leaves the physics clock behind, so the first process frame runs a burst of
# catch-up steps before the deferred scene swap lands; count on the floor, not on frames.
await wait_for(spawned_on_floor,2.0,"Fresh run spawns on visible ground")
level=current_scene
player=level.player
check(player.hp==3,"Fresh run starts at full health")
await process_frame
level._resume()
check(player.hp==3 and player.is_on_floor(),"Fresh run spawns on visible ground")
check(level.music.stream==level.FOREST_MUSIC,"The Enchanted Repo theme starts traversal")
check(not level.boss.active and level.boss.hp==12,"Monolith waits with intact armor")
await capture("/tmp/enchanted-spawn.png")
Expand Down
10 changes: 8 additions & 2 deletions hoppys-adventure-arcade/tests/orbital_ops_smoke.gd
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ func place(pos: Vector2) -> void:
player.reset_physics_interpolation()
level.camera.reset_smoothing()

func spawned_on_floor() -> bool:
var scene := current_scene
return scene!=null and scene.get("player")!=null and scene.player.is_on_floor()

func run() -> void:
change_scene_to_file("res://scenes/platformer/orbital_ops.tscn")
await frames(12)
# Engine start-up leaves the physics clock behind, so the first process frame runs a burst of
# catch-up steps before the deferred scene swap lands; count on the floor, not on frames.
await wait_for(spawned_on_floor,2.0,"Spawn settles on visible station floor")
level=current_scene
player=level.player
check(player.hp==3,"Fresh run starts at full health")
await process_frame
level._resume()
check(player.hp==3 and player.is_on_floor(),"Spawn settles on visible station floor")
check(level.music.stream==level.ORBITAL_LEVEL_MUSIC,"Zero-G Deploy starts traversal")
check(level.projectiles.get_child_count()==0 and not level.boss.active,"Fresh run starts with inactive boss and no shots")
await capture("/tmp/orbital-spawn.png")
Expand Down
Loading