diff options
author | David Thompson <dthompson2@worcester.edu> | 2013-06-25 19:50:16 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2013-06-25 19:50:16 -0400 |
commit | a59a6579c49d8acb0c328316844befe8ea3379ce (patch) | |
tree | 0b6bc272376a533f5e75736c02e6e7d88a28b059 /examples | |
parent | e8874c71b69fef1ea5a0cfc796e621cf69fedb32 (diff) |
Update simple example program.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/simple.scm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/simple.scm b/examples/simple.scm index dd09cb0..f65a14c 100644 --- a/examples/simple.scm +++ b/examples/simple.scm @@ -4,17 +4,17 @@ (2d game-loop) (2d window) (2d input) + (2d helpers) (ice-9 format)) (define window-width 800) (define window-height 600) (define sprite #f) -(define (key-down key) - (cond ((or (= key (keycode escape)) - (= key (keycode q))) - (close-window) - (quit)))) +(define (key-down key mod unicode) + (cond ((any-equal? key (keycode escape) (keycode q)) + (close-window) + (quit)))) ;; Draw our sprite (define (render) @@ -22,7 +22,7 @@ ;; Register callbacks. (set-render-callback (lambda () (render))) -(set-key-down-callback (lambda (key) (key-down key))) +(set-key-down-callback (lambda (key mod unicode) (key-down key mod unicode))) ;; Open the window. (open-window window-width window-height) |