summaryrefslogtreecommitdiff
path: root/2d
diff options
context:
space:
mode:
Diffstat (limited to '2d')
-rw-r--r--2d/game.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/2d/game.scm b/2d/game.scm
index 4a1d88f..c7fa02f 100644
--- a/2d/game.scm
+++ b/2d/game.scm
@@ -34,15 +34,18 @@
;; When no event callbacks are specified for a scene, these
;; (hopefully) convenient defaults will be used.
-(define default-scene-events
+(define %default-scene-events
`((quit . ,(lambda (state) (quit-game-loop!)))
(key-down . ,(lambda (state key mode unicode)
(when (any-equal? key 'escape 'q)
(quit-game-loop!))))))
+(define (default-scene-events)
+ (copy-tree %default-scene-events))
+
(define* (make-scene #:optional #:key
(title "A Guile-2D Scene")
- (events default-scene-events)
+ (events (default-scene-events))
(update (lambda (s) #f))
(draw (lambda (s) #f))
(state #f))