summaryrefslogtreecommitdiff
path: root/examples/particles.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2013-06-25 18:18:25 -0400
committerDavid Thompson <dthompson2@worcester.edu>2013-06-25 18:18:25 -0400
commit0410eda4a37a123c173f971d2050b41f79eb74fc (patch)
tree217c6f654234c132b6fbcc6f9c974cb2fb8976eb /examples/particles.scm
parent6c3f3066945ae49c612d3a52e6496b26a9d55193 (diff)
Update examples to use new keycode enumeration.
Diffstat (limited to 'examples/particles.scm')
-rw-r--r--examples/particles.scm13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/particles.scm b/examples/particles.scm
index 28420b6..a446bff 100644
--- a/examples/particles.scm
+++ b/examples/particles.scm
@@ -9,7 +9,8 @@
(2d sprite)
(2d game-loop)
(2d window)
- (2d vector))
+ (2d vector)
+ (2d input))
(set! *random-state* (random-state-from-platform))
@@ -63,7 +64,7 @@
(define stars (load-sprite "stars.png" #:anchor #(0 0)))
(define particle-image (load-texture "bullet.png"))
-(define num-particles 300)
+(define num-particles 1800)
(define particles
(list-tabulate num-particles
(lambda (n)
@@ -78,10 +79,10 @@
(set-key-down-callback (lambda (key) (key-down key)))
(define (key-down key)
- (case key
- ((SDLK_ESCAPE SDLK_q)
- (close-window)
- (quit))))
+ (cond ((or (= key (keycode escape))
+ (= key (keycode q)))
+ (close-window)
+ (quit))))
(define (render)
(draw-sprite stars)