feat(packages): ludic.aim - what the crosshair is on: a ray through the middle of the screen against upright cylinders widened by a fixed angular forgiveness, the nearest one the ground does not hide, reach floored at three metres, and which thing the use key means (that, nothing and say why, or the nearest); the probe of the ground's own answer against the aim; the camera, the ground and the body through a port

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 09:07:51 +03:00
parent 24a35f1174
commit dc71fc986c
10 changed files with 399 additions and 0 deletions

View file

@ -0,0 +1,15 @@
# use.ludic - the thing the use key should act on. The ray comes first and proximity is its fallback,
# never its override:
# under the crosshair and in reach -> that, whatever else is nearer
# under the crosshair and too far -> NOTHING (the prompt says why), within AIM_USE_MAX
# nothing of that kind aimed at -> the nearest thing in reach
# A player looking at something who presses the key has said which thing they mean.
export const AIM_USE_THIS: int = 0
export const AIM_USE_NOTHING: int = 1
export const AIM_USE_NEAREST: int = 2
export function aim_use(kind: int) -> int {
if am_kind == kind and am_reach { return AIM_USE_THIS }
if am_kind == kind and am_dist < AIM_USE_MAX { return AIM_USE_NOTHING }
return AIM_USE_NEAREST
}