summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2013-06-25 07:44:02 -0400
committerDavid Thompson <dthompson2@worcester.edu>2013-06-25 07:44:02 -0400
commitcc2ee1128583b44357827ab2f0c7a692463359c9 (patch)
treebcede40b324e18787d5868176cac95049529355e /examples
parent17a61d9d0c5675a1b5bf8a3abac15c62a0eb1181 (diff)
Update simple demo.
Diffstat (limited to 'examples')
-rw-r--r--examples/simple.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/simple.scm b/examples/simple.scm
index f9ee142..a988d25 100644
--- a/examples/simple.scm
+++ b/examples/simple.scm
@@ -2,20 +2,22 @@
(figl gl)
(2d sprite)
(2d game-loop)
- (2d window)
- (2d vector))
+ (2d window))
(define window-width 800)
(define window-height 600)
(define sprite #f)
(define (key-down key)
+ (display key) (newline)
(case key
;; Quit program when ESCAPE or Q is pressed.
+ ;; For now we have to use the SDL keycodes, but not for long!
((SDLK_ESCAPE SDLK_q)
(close-window)
(quit))))
+;; Draw our sprite
(define (render)
(draw-sprite sprite))
@@ -26,7 +28,7 @@
;; Open the window.
(open-window window-width window-height)
-;; Load a sprite.
+;; Load a sprite and center it on the screen.
;; Must be done AFTER opening the window.
(set! sprite (load-sprite "sprite.png" #:position (vector (/ window-width 2)
(/ window-height 2))))