Skip to content

Conversation

@jackandcarter
Copy link
Owner

Motivation

  • Restore patrol ET craft behavior to match the original purple ETs: pass across the screen on a set path, retain detection/shooting, and exhibit jittered lateral motion while optionally biasing toward the player.
  • Eliminate the undesired patterned/sinusoidal-only movement and make patrols traverse consistently from spawn side to exit.
  • Ensure patrol craft despawn when they exit the camera bounds instead of lingering offscreen.

Description

  • Replaced the old startY/direction patrol fields with a patrolDirection vector and set initial velocity to patrolDirection * moveSpeed on enable.
  • Added patrolTargetBias and patrolDespawnPadding inspector fields and implemented ResolvePatrolDirection() to derive traversal direction from spawn side.
  • Rewrote PatrolMovement() to compute lateral jitter using Perlin noise (combining wanderAmplitude / wanderFrequency and patrolJitterAmplitude / patrolJitterFrequency) and to blend movement toward the target using Vector2.Lerp with patrolTargetBias when the player is within detectionRange.
  • Added IsPastPatrolBounds() logic to deactivate (despawn) patrol craft once they pass the view bounds plus patrolDespawnPadding.

Testing

  • No automated tests were run for this change.

Codex Task

@jackandcarter jackandcarter merged commit c237c9d into v1.0.4 Dec 27, 2025
1 of 2 checks passed
@jackandcarter jackandcarter deleted the codex/fix-enemy-movement-behaviors branch December 27, 2025 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants