screens can load their resources

This commit is contained in:
Bryce Covert
2017-05-27 17:11:16 -07:00
parent 5332683347
commit b863e1de12
9 changed files with 48 additions and 45 deletions

View File

@@ -194,9 +194,7 @@
(particle-effect! (get-in @entities [:room :entities :magic-frog-particle]) :reset)
(particle-effect! (get-in @entities [:room :entities :magic-frog-particle]) :start)
(Thread/sleep 1500)
(actions/transition-background entities :outside-house [257 90] :face :left)
(dotimes [_ 160]
(particle-effect! (get-in @entities [:rooms :inside-house :entities :magic-frog-particle]) :update 0.2)))
(actions/transition-background entities :outside-house [257 90] :face :left))
(defn do-prophecy [entities]
{:run #(do (actions/respond entities %
@@ -605,20 +603,21 @@
(defn make [screen]
(let [sheep-stand-sheet (texture! (utils/get-texture "outsidehouse/sheep-anim.png") :split 33 21)
sheep-walk-sheet (texture! (utils/get-texture "outsidehouse/sheep-walk.png") :split 33 21)
lamb-walk-sheet (texture! (utils/get-texture "outsidehouse/lamb-walk.png") :split 27 28)
(let [[screen atlas] (utils/acquire-atlas screen "packed/outsidehouse.atlas")
sheep-stand-sheet (texture! (utils/atlas->texture atlas "sheep-anim") :split 33 21)
sheep-walk-sheet (texture! (utils/atlas->texture atlas "sheep-walk") :split 33 21)
lamb-walk-sheet (texture! (utils/atlas->texture atlas "lamb-walk") :split 27 28)
sheep-stand (animation 0.15 (for [i (flatten [(repeat 10 0) 1 2 3 4 5 6 7 4 5 6 7 8 2 1 (repeat 25 11) (repeat 15 12)])]
(aget sheep-stand-sheet 0 i)))
sheep-1 (utils/make-anim "outsidehouse/sheep-1.png" [33 21] 0.15 (flatten [(repeat 10 0) 1 2 3 4 5 6 7 4 5 6 7 8 2 1 (repeat 25 0) (repeat 15 9)]))
sheep-2 (utils/make-anim "outsidehouse/sheep-2.png" [33 21] 0.15 (flatten [(repeat 10 0) 1 2 3 4 5 6 7 4 5 6 7 8 2 1 (repeat 25 0) (repeat 15 9)]))
sheep-3 (utils/make-anim "outsidehouse/sheep-3.png" [33 21] 0.15 (flatten [(repeat 10 0) 1 2 3 4 5 6 7 4 5 6 7 8 2 1 (repeat 25 0) (repeat 15 9)]))
door (utils/make-anim "outsidehouse/door.png" [24 58] 0.15 (flatten [(range 4) 3 3 3 3 3 3 3]))
sheep-1 (utils/make-anim atlas "sheep-1" [33 21] 0.15 (flatten [(repeat 10 0) 1 2 3 4 5 6 7 4 5 6 7 8 2 1 (repeat 25 0) (repeat 15 9)]))
sheep-2 (utils/make-anim atlas "sheep-2" [33 21] 0.15 (flatten [(repeat 10 0) 1 2 3 4 5 6 7 4 5 6 7 8 2 1 (repeat 25 0) (repeat 15 9)]))
sheep-3 (utils/make-anim atlas "sheep-3" [33 21] 0.15 (flatten [(repeat 10 0) 1 2 3 4 5 6 7 4 5 6 7 8 2 1 (repeat 25 0) (repeat 15 9)]))
door (utils/make-anim atlas "door" [24 58] 0.15 (flatten [(range 4) 3 3 3 3 3 3 3]))
sheep-walk (animation 0.05 (for [i (range 6)]
(aget sheep-walk-sheet 0 i)))
butterfly-stand (utils/make-anim "butterfly.png" [7 7] 0.1 [0 1])
cauldron (utils/make-anim "outsidehouse/cauldron.png" [50 38] 0.15 (range 4))
charcoal (utils/make-anim-seq "outsidehouse/charcoal" [24 18] 0.25 (range 4))
cauldron (utils/make-anim atlas "cauldron" [50 38] 0.15 (range 4))
charcoal (utils/make-anim-seq atlas "charcoal" [24 18] 0.25 (range 4))
scaler (utils/scaler-fn-with-baseline 110 0.10 1.00)
lamb-stand (aget lamb-walk-sheet 0 0)
lamb-walk (animation 0.075 (for [i (range 4)]
@@ -792,7 +791,7 @@
:y 105
:baseline 238)
:door (assoc (animation->texture screen door)
:x 252 :y 88 :baseline 122
:x 252 :y 88 :baseline 123
:open door
:door-sound (utils/load-sound "door.ogg")
:anim-sound-frames {door {1 [:door-sound 0.1]}}