summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--2d/game-loop.scm18
1 files changed, 13 insertions, 5 deletions
diff --git a/2d/game-loop.scm b/2d/game-loop.scm
index a0ce798..e8e1099 100644
--- a/2d/game-loop.scm
+++ b/2d/game-loop.scm
@@ -240,11 +240,19 @@ the stack."
(run-repl)
(SDL:delay tick-interval)
accumulator)
- (let ((remainder (update accumulator)))
- (run-repl)
- (render dt)
- (switch-scenes-maybe)
- remainder)))
+ (catch #t
+ (lambda ()
+ (let ((remainder (update accumulator)))
+ (run-repl)
+ (render dt)
+ (switch-scenes-maybe)
+ remainder))
+ (lambda (key . args)
+ (pause-game)
+ accumulator)
+ (lambda (key . args)
+ (display-backtrace (make-stack #t)
+ (current-output-port))))))
(define (game-loop last-time accumulator)
"Update game state, and render. LAST-TIME is the time in