1
Seek
Heads straight at you and never lets up.
prompt.txt3,009 chars
Seek: Heads straight at you and never lets up.
Goal: Make my enemy chase the player with Seek steering, so it feels relentless: it always heads straight for where the player is right now.
Use what my project already has:
- The player and the enemy. If either is missing, add a placeholder: one plain solid-colored square or circle, made with my engine's most basic built-in shape or sprite object. A placeholder player moves with WASD or the arrow keys at a constant speed, with no acceleration.
- Take every speed, distance and size from what my game already uses: the enemy's move speed and size, the player's speed. If there are no such values, make the player cross the screen in 2.5 seconds, set the enemy's speed to 90% of the player's, and size characters at 1/16 of the screen height.
Behavior. The pseudocode below is the exact behavior. Translate it line by line into my engine's language; keep every number, and do not add, remove, reorder or smooth anything:
every frame:
toPlayer = player.pos - enemy.pos
dist = length(toPlayer)
if dist > body: # closer than one body length: stand still
enemy.pos += normalize(toPlayer) * min(speed * dt, dist - body)
In the pseudocode:
- pos is a center position on the play plane (the ground plane in 3D). body is the enemy's body length, its larger side. speed is the enemy's move speed. dt is this frame's delta time in seconds.
- normalize of a zero vector is the zero vector. perpendicular(v) is v turned 90 degrees on the play plane.
- "pos += x" means move by x this frame. If my project moves characters through physics or its own movement code, make the same move through that (velocity = x / dt) instead of setting the position directly, so walls still stop it.
Edge cases:
- Frame-rate independent: scale every movement and every timer by the frame's delta time.
- Works in 2D and 3D. In 3D, move on the ground plane.
- The enemy has no physical collision with the player: it never pushes, blocks or knocks back the player, and the two can overlap.
- Add only what is described here. No health, damage, knockback, sound, particles, trails, UI, walls or obstacles, and do not change how the player moves. If my project already has any of these, leave them exactly as they are.
The feel depends on these, so keep them exactly:
- Constant pressure: it never stops or hesitates while the player is out of reach.
- The player can outrun it, but only just.
Before you finish, check your work:
- Does it aim at the player's current position every frame, never ahead of it and never past it?
- Is its speed constant until it is one body length from the player?
- Does every number come from my project or the fallback above, with nothing left for me to set?
- Does it behave the same at 30 and 144 frames per second?
- Does the project run with no errors or warnings in my engine version, as soon as I start the game, with no extra setup?
- Did you add nothing beyond what is described?Works with any AI coding tool. Paste it into your project and run.

