Show the laser's whole reach while aiming
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
This commit is contained in:
parent
571f01dc31
commit
a902fddba0
4 changed files with 70 additions and 7 deletions
|
|
@ -124,6 +124,17 @@ func _process(delta: float) -> bool:
|
|||
return _fail_now("aiming did not zoom out")
|
||||
print("aiming zoomed the camera out")
|
||||
|
||||
# #203: far enough out to show the WHOLE beam. The drag above is
|
||||
# horizontal, so the screen's narrow half is the binding one.
|
||||
var half_screen: Vector2 = skill.get_viewport_rect().size * 0.5 \
|
||||
- Vector2(54.0, 54.0)
|
||||
var framed: float = (2900.0 + BEAM_HALF_WIDTH) \
|
||||
* main.get_node("Camera2D").zoom.x
|
||||
if framed > half_screen.x + 1.0:
|
||||
return _fail_now("aiming framed %.0fpx of beam on %.0fpx of screen" \
|
||||
% [framed, half_screen.x])
|
||||
print("aiming framed the beam's full range")
|
||||
|
||||
# --- B. targets: two on the line, one off it, one past range ---
|
||||
for offset in [Vector2(200.0, 0.0), Vector2(500.0, 0.0)]:
|
||||
var enemy: Node = load("res://enemies/Enemy.tscn").instantiate()
|
||||
|
|
|
|||
Loading…
Reference in a new issue