Skip to content

A gaze-controlled homage to Atari's Missile Command built for macOS Vision Accessibility

License

Notifications You must be signed in to change notification settings

dgbenner/vision-command-2026

Repository files navigation

Vision Command 2026

A gaze-controlled homage to Atari's Missile Command built for macOS Vision Accessibility

Overview

Vision Command 2026 is a simple arcade-style prototype where you defend cities from falling missiles using eye tracking and face gestures instead of a mouse or keyboard.

It's designed as:

  • A playful demo of macOS Pointer Control / Vision Accessibility
  • A testbed for gaze target selection, dwell timing, and large-hit-area UI
  • An example of how classic arcade games can be reimagined for hands-free play

You move a targeting reticle with your eyes and fire interceptors with blinks or dwell to destroy incoming missiles before they hit your cities.


System Requirements

  • OS: macOS Sonoma (14.0) or newer
  • Hardware:
    • Mac with FaceTime HD camera (minimum)
    • TrueDepth camera recommended for enhanced face gesture support
  • Accessibility: macOS Pointer Control enabled (System Settings → Accessibility → Pointer Control)

Core Gameplay

  • A row of cities sits at the bottom of the screen.
  • Enemy missiles fall from the top toward random cities.
  • You control a crosshair with your gaze.
  • When your gaze rests on a location and you trigger a fire gesture, an interceptor launches upward and explodes in a small radius.
  • Any enemy missiles that pass through the explosion are destroyed.
  • If all cities are destroyed, the game ends.

This is intentionally slower-paced than the original Missile Command to match the realities of gaze input (limited precision and higher fatigue).


Controls (Gaze + Face Gestures)

Gaze and gesture mapping is intentionally simple and forgiving:

Pointer / Aim

  • Move reticle: Your eyes move the system pointer via macOS Pointer Control (Vision → Eye Tracking).
  • The game continuously reads pointer position and keeps the crosshair centered on it.

Fire / Action

Recommended for first-time users: Start with dwell-to-fire as it requires no additional gesture configuration and works immediately after eye tracking calibration.

You can choose one (or support multiple):

  • Dwell-to-fire (Recommended Default)

    • Rest your gaze (pointer) on a spot for X ms (e.g., 500–700 ms).
    • Game interprets this as a "click" and launches an interceptor.
  • Blink-to-fire

    • Map a blink or eye-closure gesture in macOS Accessibility as a "click-equivalent" action.
    • Game treats click events as firing commands at the current crosshair location.
  • Eyebrow Raise or Mouth Open (Optional)

    • You can map a face gesture (raised eyebrows, open mouth) to a click.
    • Great as an alternative to dwell if users find long staring tiring.

Pause / Menu

  • Look at a corner (e.g., top-left safe zone) and dwell for >1 second to open a basic pause menu.
  • Alternatively, use a standard keyboard shortcut (e.g., Esc) for non-hands-free testing.

New to gaze control? See /docs/setup-guide.md for step-by-step instructions on enabling and calibrating macOS Pointer Control.


Design Goals

  1. Large Targets, Slow Pace

    • Incoming missiles are slower than in the original arcade game.
    • Explosion radius is slightly generous.
    • This gives gaze time to land on a meaningful point.
  2. Short Sessions

    • Games are meant to last 1–3 minutes, respecting eye strain and fatigue.
  3. Accessibility-First

    • Playable with no mouse and minimal keyboard use.
    • Calibration and sensitivity tuned for imperfect eye-tracking and jitter.
  4. Toy Prototype, Not Esport

    • The goal is a fun demo of gaze interaction, not a high-precision, high-APM game.

Technical Overview

Platform

  • OS: macOS (Sonoma or newer)
  • Input: macOS Pointer Control (Vision Accessibility – Eye Tracking / Head Pointer / Face Gestures)
  • Language / Framework:
    • Example: Swift + SpriteKit (2D game framework)
    • But the concept is agnostic; any engine that can read pointer location and clicks will work.

Input Model

The game does not implement its own raw eye-tracking.
Instead it relies on:

  • System pointer position = gaze proxy
  • System "click" = fire command, whether generated by:
    • Dwell click
    • Blink gesture
    • Face gesture
    • Or traditional mouse click (for debugging)

This keeps the prototype aligned with built-in macOS accessibility features rather than external SDKs.

Performance Considerations

The game polls pointer position at a consistent frame rate (targeting 60 FPS) with input smoothing applied to reduce gaze jitter. Dwell timing uses a rolling average of pointer stability rather than raw position to prevent false triggers from natural eye micro-movements.


Game Loop (High-Level)

  1. Spawn missiles at random positions along the top edge.
  2. Each frame:
    • Move missiles along their trajectory toward chosen cities.
    • Check for explosion collision with missiles.
    • Remove destroyed missiles and trigger simple effects.
    • Detect city impact when missiles reach the ground.
  3. Read current pointer position and display crosshair.
  4. On fire event (click / dwell / blink):
    • Spawn interceptor at the nearest base or at ground level under the crosshair.
    • Interceptor travels upward then creates an explosion circle.
  5. When all cities are destroyed:
    • Show Game Over screen with stats (time survived, missiles destroyed).

Repository Structure

vision-command-2026/
├─ README.md
├─ LICENSE
├─ /src
│  ├─ GameScene.swift        # Main game loop, spawning, collisions
│  ├─ GazeReticle.swift      # Crosshair logic (follows pointer)
│  ├─ Missile.swift          # Enemy projectile behavior
│  ├─ Interceptor.swift      # Player projectile + explosion logic
│  ├─ City.swift             # City objects, hit handling
│  └─ UIOverlay.swift        # HUD, score, pause, accessibility hints
├─ /assets
│  ├─ sprites/               # Simple shapes or retro-styled art
│  ├─ sounds/                # Launch, explosion, alert sounds
│  └─ fonts/
└─ /docs
   ├─ setup-guide.md         # Step-by-step macOS Pointer Control setup
   ├─ accessibility-notes.md # Details on gaze/gesture configuration
   └─ design-notes.md        # Game design & tuning notes

Getting Started

  1. Enable macOS Pointer Control in System Settings → Accessibility
  2. Complete the eye tracking calibration
  3. Clone this repository and open the project
  4. Build and run the game
  5. Start with dwell-to-fire, then experiment with gesture controls

For detailed setup instructions, see /docs/setup-guide.md.


License

MIT License - See LICENSE file for details

About

A gaze-controlled homage to Atari's Missile Command built for macOS Vision Accessibility

About

A gaze-controlled homage to Atari's Missile Command built for macOS Vision Accessibility

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages