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>
27 lines
849 B
Racket
27 lines
849 B
Racket
#lang r7rs
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;; All Tests ;;
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; Runs all ADT tests. Open this file and evaluate to run everything.
|
|
|
|
(import (scheme base)
|
|
(pp1 tests)
|
|
(prefix (pacman-project tests test-position) position:)
|
|
(prefix (pacman-project tests test-maze) maze:)
|
|
(prefix (pacman-project tests test-pacman) pacman:)
|
|
(prefix (pacman-project tests test-ghost) ghost:)
|
|
(prefix (pacman-project tests test-score) score:)
|
|
(prefix (pacman-project tests test-timer) timer:))
|
|
|
|
(define (test-all)
|
|
(position:test)
|
|
(maze:test)
|
|
(pacman:test)
|
|
(ghost:test)
|
|
(score:test)
|
|
(timer:test))
|
|
|
|
(test-all)
|