Draw capture points behind fleet vessels (#50)
CapturePoint.gd left z_index at its default 0, the same layer Ship draws on, so a ship parked inside a ring was partly swallowed by the ring fill - exactly where the player most needs to see their own vessels. Set z_index = -1, matching the convention every other world object already follows (Planet, Rock, Building, Hauler, Transporter, VesselDelivery). Verified with a ship placed directly on a capture point in the preview screenshot, and asserted in test_capture_points.gd.
This commit is contained in:
parent
df2f252970
commit
5b2dd77e47
3 changed files with 12 additions and 1 deletions
|
|
@ -28,7 +28,10 @@ func _ready() -> void:
|
|||
|
||||
# Lay the three points out in a compact, clearly-separated triangle for
|
||||
# the screenshot, rather than the real (far-flung) authored positions.
|
||||
var layout: Array = [Vector2(300, 150), Vector2(-300, 150), Vector2(0, -280)]
|
||||
# Point 0 sits at the origin - exactly where the fleet spawns - so the
|
||||
# screenshot also proves the #50 z_index fix: the ring must not occlude
|
||||
# the ships parked on top of it.
|
||||
var layout: Array = [Vector2(0, 0), Vector2(-300, 150), Vector2(300, -200)]
|
||||
for i in range(mini(points.size(), layout.size())):
|
||||
points[i].position = layout[i]
|
||||
|
||||
|
|
|
|||
|
|
@ -197,6 +197,8 @@ func _process(delta: float) -> bool:
|
|||
# through the build UI here to avoid duplicating that coverage.
|
||||
if not game_state.is_planet_conquered(planet_id):
|
||||
return _fail("single-point planet was not marked conquered")
|
||||
if point.z_index >= 0:
|
||||
return _fail("capture point does not draw behind the fleet/enemies (z_index=%d)" % point.z_index)
|
||||
|
||||
print("TEST_CAPTURE_POINTS: PASS")
|
||||
quit(0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue