summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/particles.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/examples/particles.scm b/examples/particles.scm
index e9af860..5e7ee7a 100644
--- a/examples/particles.scm
+++ b/examples/particles.scm
@@ -23,7 +23,8 @@
(load "common.scm")
(define (particle-position n time life-span)
- (polar2 (* time 2) (* n n)))
+ (polar2 (+ (* time 2) (* (modulo n 17) (/ time 8)))
+ (+ (/ (sin (* n n)) 7) pi/2)))
(define-signal texture
(on-start (load-texture "images/bullet.png")
@@ -32,13 +33,14 @@
(define-signal particle-system
(signal-let ((texture texture))
(make-particle-system #:texture texture
- #:emit-rate 4
- #:life-span 200
+ #:emit-interval 2
+ #:emit-count 16
+ #:life-span 60
#:renderer (make-simple-particle-renderer
particle-position))))
(define-signal batch
- (on-start (make-sprite-batch 1024)))
+ (on-start (make-sprite-batch 4096)))
(define-signal scene
(signal-let ((particle-system particle-system)
@@ -47,7 +49,7 @@
(if batch
(with-camera (2d-camera #:area (make-rect 0 0 640 480))
(with-blend-mode (make-blend-mode 'src-alpha 'one)
- (move (vector2 320 240)
+ (move (vector2 320 180)
(render-particles particle-system batch time))))
render-nothing)))