Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define draw-game
- (lambda (g)
- (letrec ((newgame ((game-behaviour g) g))
- (pc (game-pacman g))
- (f (game-field g))
- (newscore (game-score newgame))
- (newlives (score-lives newscore))
- (offs (round (/ (- tile-width (* 2 (pacman-r pc))) 2)))
- ; böse, aber aus Performancegründen leider notwendig
- (_ (set! draw-field (if (= newlives 0)
- (field-image start-field)
- (freeze
- (draw-tile " "
- (tile-x (field-tile f))
- (tile-y (field-tile f))
- draw-field))))))
- (place-image (draw-score g)
- 200 30
- (fold
- (if ( < (+ (+ (* tile-width (pacman-col pc)) (span (pacman-offset-col pc))) offs) 0)
- (underlay/xy
- draw-field
- 0
- (+ (+ (* tile-width (pacman-row pc)) (span (pacman-offset-row pc))) offs)
- (crop 0 0 0 0 (draw-pacman pc)))
- (underlay/xy
- draw-field
- (+ (+ (* tile-width (pacman-col pc)) (span (pacman-offset-col pc))) offs)
- (+ (+ (* tile-width (pacman-row pc)) (span (pacman-offset-row pc))) offs)
- (draw-pacman pc)))
- (lambda (gh img)
- (if ( < (+ (+ (* tile-width (pacman-col pc)) (span (pacman-offset-col pc))) offs) 0)
- (underlay/xy
- img
- 0
- (+ (+ (* tile-width (ghost-row gh)) (span (ghost-offset-row gh))) offs)
- (crop 0 0 0 0(draw-ghost gh)))
- (underlay/xy
- img
- (+ (+ (* tile-width (ghost-col gh)) (span (ghost-offset-col gh))) offs)
- (+ (+ (* tile-width (ghost-row gh)) (span (ghost-offset-row gh))) offs)
- (draw-ghost gh))))
- (game-ghosts g))))))
Add Comment
Please, Sign In to add comment