summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@vistahigherlearning.com>2019-07-18 07:44:05 -0400
committerDavid Thompson <dthompson@vistahigherlearning.com>2019-07-18 07:44:05 -0400
commitae2b4a776f015928392a284adee81bf6aa48eb31 (patch)
tree18f597c7274ea6b82e31ce317db66ef5aa4ad2b7
parenta8a03957c563fc87272e51de3b69d11d57828aae (diff)
node-2d: Add particles node.
-rw-r--r--starling/node-2d.scm20
1 files changed, 19 insertions, 1 deletions
diff --git a/starling/node-2d.scm b/starling/node-2d.scm
index a66f6d5..7385c98 100644
--- a/starling/node-2d.scm
+++ b/starling/node-2d.scm
@@ -30,6 +30,7 @@
#:use-module (chickadee render color)
#:use-module (chickadee render font)
#:use-module (chickadee render framebuffer)
+ #:use-module (chickadee render particles)
#:use-module (chickadee render shapes)
#:use-module (chickadee render sprite)
#:use-module (chickadee render texture)
@@ -113,7 +114,10 @@
<tile-map>
tile-map
- layers))
+ layers
+
+ <particles>
+ particles))
;;;
@@ -617,3 +621,17 @@
(let ((m (asset-ref (tile-map node))))
(draw-tile-map* m (world-matrix node) (tile-map-rect m)
#:layers (layers node))))
+
+
+;;;
+;;; Particles
+;;;
+
+(define-class <particles> (<node-2d>)
+ (particles #:accessor particles #:init-keyword #:particles))
+
+(define-method (update (node <particles>) dt)
+ (update-particles (particles node)))
+
+(define-method (render (node <particles>) alpha)
+ (draw-particles* (particles node) (world-matrix node)))