#139: the prologue's debris belt keeps off the screen too
The belt was laid out with its own arithmetic - a centre BELT_AHEAD in front of the fleet, rocks spread BELT_DEPTH either side of it - so its near edge reached back to within a screen of the convoy. At the aspect it was eyeballed on that was just outside the view; at a wider one, or any zoom out, rocks appeared in plain sight. #126 already answered this question for the rest of the game, so the answer is borrowed rather than restated: AsteroidField's keep-out rect and its push-out-through-the-nearest-edge placement are public now, and the belt runs through them. That also means the two cannot drift apart later. The distance moves as well, 2200 to 2900. The clamp alone would work, but it would work by pressing every stray rock onto the boundary line; with the belt properly out in front, the clamp has almost nothing left to do and the belt still looks laid out ahead rather than pinned to the edge of the screen. Measured: nearest rock 1551 units out, against a keep-out that reaches 1100.
This commit is contained in:
parent
1ece202731
commit
ac4b96ef49
6 changed files with 51 additions and 144 deletions
|
|
@ -32,6 +32,7 @@ extends SceneTree
|
|||
# P. #128 - the prologue opens STOPPED behind its first line, and
|
||||
# acknowledging it is what starts the world
|
||||
# Q. #133 - the handover runs straight into the first quest
|
||||
# R. #139 - no belt rock is laid down inside the visible screen
|
||||
|
||||
var game_state: Node
|
||||
var scene: Node
|
||||
|
|
@ -276,6 +277,26 @@ func _process(delta: float) -> bool:
|
|||
% [ahead, standing.size()])
|
||||
print("belt: %d rocks, %d of them across the lane ahead" % [standing.size(), ahead])
|
||||
|
||||
# --- R. #139: and none of it appears on screen ------------
|
||||
# The belt used to be laid out with its own arithmetic, which put
|
||||
# its near edge within a screen of the fleet - so rocks popped
|
||||
# into existence in view. It goes through the asteroid field's
|
||||
# own keep-out now, the same one #126 gave the rest of the game.
|
||||
var field: Node2D = scene.get_node("AsteroidField")
|
||||
var keep_out: Rect2 = field.keep_out_rect(fleet.get_centroid())
|
||||
var visible_rect: Rect2 = ViewUtils.get_visible_world_rect(field)
|
||||
if visible_rect.size.x > 1.0 and not keep_out.encloses(visible_rect):
|
||||
return _fail("the belt's keep-out %s does not cover the screen %s" \
|
||||
% [keep_out, visible_rect])
|
||||
var nearest: float = 1.0e9
|
||||
for rock in standing:
|
||||
if keep_out.has_point(rock.global_position):
|
||||
return _fail("a belt rock was laid down at %s, inside the view %s" \
|
||||
% [rock.global_position, keep_out])
|
||||
nearest = minf(nearest, absf(rock.global_position.y - fleet.get_centroid().y))
|
||||
print("no belt rock inside the keep-out %.0fx%.0f; nearest is %.0f ahead" \
|
||||
% [keep_out.size.x, keep_out.size.y, nearest])
|
||||
|
||||
# --- G. the breach takes the wheel ----------------------
|
||||
director._begin(director.Beat.BREACH)
|
||||
if not game_state.intro_locks_movement:
|
||||
|
|
|
|||
Loading…
Reference in a new issue