refinement.

This commit is contained in:
2014-12-10 13:07:08 -08:00
parent bb7dcb3628
commit 3639e4fd06
4 changed files with 72 additions and 50 deletions

View File

@@ -14,7 +14,7 @@
(let [peddler-sheet (texture! (texture "outside-castle/peddler-talk.png" ) :split 18 36)
peddler-talk (animation 0.18 (for [i (flatten [2 3 2 3 2 3 6 1 0 1 0 1 0 1 0 1 2 3 2 3 2 3 6 4 5 4 5 4 5 4 5])]
(aget peddler-sheet 0 i)))
peddler-stand (animation 0.2 (for [i (flatten [(repeat 5 0) 6])]
peddler-stand (animation 0.2 (for [i (flatten [(repeat 8 0) 6 (repeat 8 0) 6 (repeat 5 0) 4 5 4 5 4 5])]
(aget peddler-sheet 0 i)))
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]]
@@ -22,16 +22,11 @@
bird-sheet (texture! (texture "outside-castle/bird.png") :split 1 2)
bird-stand (animation 0.15 (for [i [0 1]]
(aget bird-sheet 0 i)))
butterfly-sheet (texture! (texture "butterfly.png") :split 7 7)
butterfly-stand (animation 0.1 (for [i [0 1]]
(aget butterfly-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)))
flies-sheet (texture! (texture "outside-castle/flies.png") :split 15 15)
flies-stand (animation 0.075 (for [i [0 1 2 1]]
(aget flies-sheet 0 i)))
]
flies-stand (utils/make-anim "outside-castle/flies.png" [15 15] 0.075 [0 1 2 1])]
(rooms/make :music :town-2
:interactions
{:right-dir {:box [300 40 320 140]
@@ -187,27 +182,25 @@
a (catmull-rom-spline! (:path entity) :value-at v pos-f)]
(assoc entity :x (vector-2! v :x) :y (vector-2! v :y)))))
:stand)
:butterfly (actions/start-animation screen
(assoc (animation->texture screen butterfly-stand)
:x 161
:y 218
:baseline 240
:stand butterfly-stand
: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)))))
:stand)
:flies (actions/start-animation screen
(assoc (animation->texture screen flies-stand)
:x 201
:y 175
:baseline 240
:stand flies-stand)
:stand)}
: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
:anim flies-stand
:anim-start 0
:baseline 240)}
:collision "outside-castle/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00)
:start-pos [310 80])))