summaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
authorBoutade <thegoofist@protonmail.com>2019-10-06 17:54:33 -0500
committerBoutade <thegoofist@protonmail.com>2019-10-06 17:54:33 -0500
commite6e83f5270aeb41ffd476840b8fed04ebe8b0925 (patch)
treecb6394dd8b607d3b09f7d1cafe64343b2dff0245 /README.org
parentacdb094792133368261df20685140faa73dc2d27 (diff)
example 3
Diffstat (limited to 'README.org')
-rw-r--r--README.org29
1 files changed, 28 insertions, 1 deletions
diff --git a/README.org b/README.org
index 1379aba..da10864 100644
--- a/README.org
+++ b/README.org
@@ -41,7 +41,7 @@ And here is what the above looks like
[[.images/animise-eg-3.gif]]
-*** Another example
+*** More Examples
[[.images/eg1.gif]]
@@ -78,3 +78,30 @@ Then to update each of the animations `anim` and `other-anim`, the above calls
#+end_src
before the start of the rendering step.
+
+[[.images/wavy.gif]]
+
+The code is not quite as nice for this one, but not too bad:
+
+#+begin_src lisp
+
+ (let* ((animise::*duration* 1000)
+ (rects (loop :for y :from 0 :to 48
+ :collect (sdl2:make-rect 1 (* y 8) 30 8)))
+
+ (out-anims (apply #'as-group
+ (loop :for (r . rest) :on rects
+ :collect (animating :the 'sdl2:rect-x
+ :of r :to 620 :by :cubing-in-out
+ :at (1+ (* 100 (length rest)))))))
+ (in-anims (apply #'as-group
+ (loop :for (r . rest) :on rects
+ :collect (animating :the 'sdl2:rect-x
+ :of r :to 1 :by :cubing-in-out
+ :at (1+ (* 100 (length rest)))))))
+ (anim (funcall #'in-sequence out-anims in-anims)))
+
+ (setf (loop-mode anim) :looping)
+
+
+#+end_src