Skip to content

feat: add blink-to-jump mechanic - #26

Open
gpsanant wants to merge 1 commit into
soli-testbench:mainfrom
gpsanant:venice-task-172c37a0
Open

feat: add blink-to-jump mechanic#26
gpsanant wants to merge 1 commit into
soli-testbench:mainfrom
gpsanant:venice-task-172c37a0

Conversation

@gpsanant

Copy link
Copy Markdown

Summary

Adds blink detection to the face tracking system and uses it to trigger a ball jump mechanic.

Changes

  • tracker.js: Added detectBlink() function using MediaPipe eye landmarks (159/145 for left eye, 386/374 for right eye), normalized by inter-eye distance with smoothing and 500ms cooldown
  • physics.js: Added jump physics with upward impulse (6.0), gravity arc, and track landing. Obstacle collisions are skipped while airborne. Edge falls still apply during jumps.
  • main.js: Integrated blink detection into the game loop, passing blink state to physics update

- Add detectBlink() to tracker.js using MediaPipe eye landmarks (159/145, 386/374)
  normalized by inter-eye distance, with smoothing and 500ms cooldown
- Add jump physics to physics.js with upward impulse (6.0), gravity arc, and landing
- Skip obstacle/turtle collisions while airborne; allow edge falls and lateral steering
- Integrate blink detection in game loop (main.js)

Co-Authored-By: bot_apk <apk@cognition.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant