WIP checkpoint: PC2: Build a basic playable test level scene
This commit is contained in:
@@ -21,7 +21,7 @@ func _run() -> void:
|
||||
# Load the scene file
|
||||
var level_resource: PackedScene = load(level_path)
|
||||
if level_resource == null:
|
||||
printerr("SMOKE RESULT: FAIL — could not load ", level_path)
|
||||
printerr("SMOKE RESULT: FAIL \u2014 could not load ", level_path)
|
||||
quit(1)
|
||||
return
|
||||
|
||||
@@ -30,7 +30,7 @@ func _run() -> void:
|
||||
# Change the running scene to our test level
|
||||
var err: int = change_scene_to_packed(level_resource)
|
||||
if err != OK:
|
||||
printerr("SMOKE RESULT: FAIL — change_scene_to_packed returned ", err)
|
||||
printerr("SMOKE RESULT: FAIL \u2014 change_scene_to_packed returned ", err)
|
||||
quit(1)
|
||||
return
|
||||
|
||||
@@ -39,7 +39,7 @@ func _run() -> void:
|
||||
|
||||
var level_instance: Node3D = current_scene as Node3D
|
||||
if level_instance == null:
|
||||
printerr("SMOKE RESULT: FAIL — current_scene is not Node3D")
|
||||
printerr("SMOKE RESULT: FAIL \u2014 current_scene is not Node3D")
|
||||
quit(1)
|
||||
return
|
||||
|
||||
@@ -49,7 +49,7 @@ func _run() -> void:
|
||||
# (b) Find the PlayerSpawn marker
|
||||
var spawn_marker: Node3D = level_instance.find_child("PlayerSpawn", true, false) as Node3D
|
||||
if spawn_marker == null:
|
||||
printerr("SMOKE RESULT: FAIL — no Node3D named 'PlayerSpawn' found in test level")
|
||||
printerr("SMOKE RESULT: FAIL \u2014 no Node3D named 'PlayerSpawn' found in test level")
|
||||
quit(1)
|
||||
return
|
||||
|
||||
@@ -60,17 +60,17 @@ func _run() -> void:
|
||||
# with height 1.0, so top face is at y = 0).
|
||||
var spawn_y: float = spawn_marker.global_position.y
|
||||
if spawn_y < 1.0:
|
||||
printerr("SMOKE RESULT: FAIL — PlayerSpawn y = ", spawn_y,
|
||||
printerr("SMOKE RESULT: FAIL \u2014 PlayerSpawn y = ", spawn_y,
|
||||
" is below the required minimum of 1.0 m above ground top (y=0)")
|
||||
quit(1)
|
||||
return
|
||||
|
||||
print("SMOKE: PlayerSpawn y = ", spawn_y, " >= 1.0 m — PASS")
|
||||
print("SMOKE: PlayerSpawn y = ", spawn_y, " >= 1.0 m \u2014 PASS")
|
||||
|
||||
# Additional check: verify Ground StaticBody3D exists
|
||||
var ground: StaticBody3D = level_instance.find_child("Ground", true, false) as StaticBody3D
|
||||
if ground == null:
|
||||
printerr("SMOKE RESULT: FAIL — no StaticBody3D named 'Ground' found")
|
||||
printerr("SMOKE RESULT: FAIL \u2014 no StaticBody3D named 'Ground' found")
|
||||
quit(1)
|
||||
return
|
||||
|
||||
@@ -82,10 +82,10 @@ func _run() -> void:
|
||||
var box_shape: BoxShape3D = ground_shape.shape as BoxShape3D
|
||||
var ground_top: float = ground.global_position.y + box_shape.size.y / 2.0
|
||||
if abs(ground_top - 0.0) > 0.01:
|
||||
printerr("SMOKE RESULT: FAIL — Ground top face at y = ", ground_top, " expected ~0.0")
|
||||
printerr("SMOKE RESULT: FAIL \u2014 Ground top face at y = ", ground_top, " expected ~0.0")
|
||||
quit(1)
|
||||
return
|
||||
print("SMOKE: Ground top face at y = ", ground_top, " — PASS")
|
||||
print("SMOKE: Ground top face at y = ", ground_top, " \u2014 PASS")
|
||||
|
||||
# Verify props exist (3-5 StaticBody3D children under Props node)
|
||||
var props_node: Node3D = level_instance.find_child("Props", true, false) as Node3D
|
||||
@@ -95,26 +95,27 @@ func _run() -> void:
|
||||
if child is StaticBody3D:
|
||||
prop_count += 1
|
||||
if prop_count < 3:
|
||||
printerr("SMOKE RESULT: FAIL — only ", prop_count, " props found, need >= 3")
|
||||
printerr("SMOKE RESULT: FAIL \u2014 only ", prop_count, " props found, need >= 3")
|
||||
quit(1)
|
||||
return
|
||||
print("SMOKE: found ", prop_count, " props — PASS")
|
||||
print("SMOKE: found ", prop_count, " props \u2014 PASS")
|
||||
else:
|
||||
printerr("SMOKE RESULT: FAIL — no 'Props' Node3D found")
|
||||
printerr("SMOKE RESULT: FAIL \u2014 no 'Props' Node3D found")
|
||||
quit(1)
|
||||
return
|
||||
|
||||
# Verify lighting exists
|
||||
var sun: DirectionalLight3D = level_instance.find_child("Sun", true, false) as DirectionalLight3D
|
||||
if sun == null:
|
||||
printerr("SMOKE RESULT: FAIL — no DirectionalLight3D named 'Sun' found")
|
||||
printerr("SMOKE RESULT: FAIL \u2014 no DirectionalLight3D named 'Sun' found")
|
||||
quit(1)
|
||||
return
|
||||
print("SMOKE: found Sun DirectionalLight3D")
|
||||
|
||||
var env: WorldEnvironment = level_instance.find_child("Environment", true, false) as WorldEnvironment
|
||||
# Verify WorldEnvironment exists
|
||||
var env: WorldEnvironment = level_instance.find_child("WorldEnvironment", true, false) as WorldEnvironment
|
||||
if env == null:
|
||||
printerr("SMOKE RESULT: FAIL — no WorldEnvironment named 'Environment' found")
|
||||
printerr("SMOKE RESULT: FAIL \u2014 no WorldEnvironment named 'WorldEnvironment' found")
|
||||
quit(1)
|
||||
return
|
||||
print("SMOKE: found WorldEnvironment")
|
||||
|
||||
Reference in New Issue
Block a user