Entities now move smoothly between tiles instead of snapping. Previous
positions are tracked in pacman and ghost ADTs; the draw layer linearly
interpolates between prev and current based on movement timer progress.
Residual time is carried across movement ticks for consistent speed at
varying frame rates. Teleportation and ghost house exits call sync-prev!
to prevent cross-map interpolation artifacts.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement four ghosts (Blinky, Pinky, Inky, Clyde) with authentic
Pac-Man AI: Blinky chases directly, Pinky targets 2 tiles ahead
(with original up-direction bug), Inky uses vector doubling from
Blinky, Clyde switches to scatter within 8-tile radius.
Includes chase/scatter mode cycling, ghost house exit with staggered
delays, directional sprite rendering with animation, and ghost-pacman
collision detection.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The (pp1 graphics) library resolves colors via Racket's color database,
which doesn't support hex strings — they return #f causing a contract
violation on set-brush.
Replaced all hex colors with standard names:
#2121DE -> "medium blue", #FFB851 -> "gold", #FFB8FF -> "hot pink",
#FFFF00 -> "yellow", #FF0000 -> "red", #111111 -> "dark slate gray"
Also switched coins from draw-rectangle! to draw-ellipse! for round
dot rendering (arcade-accurate).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Key bug fix:
- Key sprite position was never set on startup, appearing at (0,0)
- Added init-key-position! called in start-drawing! to place key sprite
at its grid position on load
Arcade UI polish:
- Header bar with "PAC-MAN" title in yellow
- "SCORE" label above score value in header
- Sidebar separator uses wall color instead of white block
- "TIME" label with large countdown in sidebar area
- Coins now rendered as small centered dots (coin-size constant)
- Arcade color palette: #2121DE walls, #FFB851 coins, #FFB8FF doors
- "GAME OVER" overlay in red when time expires
- "PAUSED" overlay covers maze area only (not header)
- Window title set to "PAC-MAN"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously every frame: cleared+redrawed 868 cells for coins, cleared+
redrawed all UI text, emptied+recreated pause layer, and swapped key
sprites repeatedly.
Now uses dirty flags and cached values:
- Coins: only redrawn when coins-dirty? is set (on coin eat/key pickup)
- Maze: only redrawn when a door is removed
- UI: only redrawn when score or time string actually changes
- Key: sprite swap happens exactly once, not every frame
- Pause: layer only modified when paused? state transitions
Exposes mark-coins-dirty! and mark-maze-dirty! messages so the game
ADT can signal changes from the level.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The draw callback receives no delta-time, so animation was stuck at 0.
Split draw-pacman! into draw (position/rotation) and animate-pacman!
(sprite sequence advancement). Animation is now called from the game
loop which has the real delta-time.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New structure groups all ADT modules under adt/ directory, removing
redundant adt- prefix from filenames. Library names now read as
(pacman-project adt position) etc. All imports updated accordingly.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>