adding more detail.

This commit is contained in:
2014-12-10 18:05:35 -08:00
parent 04bac2afb9
commit e7c2acead2
5 changed files with 94 additions and 41 deletions

View File

@@ -19,7 +19,7 @@
balloon-sheet (texture! (texture "outside-castle/balloons.png") :split 20 36)
balloon-stand (animation 0.25 (for [i [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2]]
(aget balloon-sheet 0 i)))
butterfly-stand (utils/make-anim "butterfly.png" [7 7] 0.1 [0 1])
steer-sheet (texture! (texture "outside-castle/steer.png") :split 50 35)
steer-stand (animation 0.2 (for [i [0 0 0 0 0 0 0 0 0 1 0 2 0 1 0 2 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 0 0 0 0]]
(aget steer-sheet 0 i)))
@@ -166,19 +166,7 @@
:bird (utils/make-bird screen (as-> [[82 235] [134 215] [185 235] [165 238]
[220 225] [210 230] [250 235]] p
(concat p (reverse p))))
:butterfly (assoc (animation->texture screen butterfly-stand)
:x 161
:y 218
:baseline 240
:anim butterfly-stand
:anim-start 0
:path (catmull-rom-spline (map #(apply vector-2* %) (take 10 (repeatedly #(vector (rand-int 320) (rand-int 180))))) true)
:update-fn (fn [screen entities entity]
(let [speed 0.009
pos-f (- (* (:total-time screen) speed) (int (* (:total-time screen) speed)))
v (vector-2 0 0)
a (catmull-rom-spline! (:path entity) :value-at v pos-f)]
(assoc entity :x (vector-2! v :x) :y (vector-2! v :y)))))
:flies (assoc (animation->texture screen flies-stand)
:x 201
:y 175