screens can load their resources
This commit is contained in:
@@ -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]}}
|
||||
|
||||
@@ -858,6 +858,8 @@
|
||||
(if anim-loop?
|
||||
(get-looped-animation-point anim last-animated-time)
|
||||
last-animated-time))]
|
||||
|
||||
|
||||
(if (and (= current-frame-index (:current-frame-index entity) (:previous-frame-index entity))
|
||||
(not (:force-rerender entity)))
|
||||
entity
|
||||
@@ -1206,23 +1208,24 @@
|
||||
|
||||
_ (update! screen :shader shader)
|
||||
log-assets (fn [r] r)
|
||||
rooms {:inside-house (rooms.inside-house/make screen)
|
||||
:inside-stash (rooms.inside-stash/make screen)
|
||||
:outside-house (rooms.outside-house/make screen)
|
||||
:behind-house (rooms.behind-house/make screen)
|
||||
:cat-tree (rooms.cat-tree/make screen)
|
||||
:inside-castle (rooms.inside-castle/make screen)
|
||||
:space (rooms.space/make screen)
|
||||
:held (rooms.held/make screen)
|
||||
:inside-cafeteria (rooms.inside-cafeteria/make screen)
|
||||
:inside-antique (rooms.inside-antique/make screen)
|
||||
:inside-jail (rooms.inside-jail/make screen)
|
||||
:dream (rooms.dream/make screen)
|
||||
:ending (rooms.ending/make screen)
|
||||
:castle-gate (rooms.castle-gate/make screen)
|
||||
:outside-jail (rooms.outside-jail/make screen)
|
||||
:outside-castle (rooms.outside-castle/make screen)}
|
||||
rooms (add-georgia-to-all-rooms screen rooms)
|
||||
rooms {:inside-house rooms.inside-house/make
|
||||
:inside-stash rooms.inside-stash/make
|
||||
:outside-house rooms.outside-house/make
|
||||
:behind-house rooms.behind-house/make
|
||||
:cat-tree rooms.cat-tree/make
|
||||
:inside-castle rooms.inside-castle/make
|
||||
:space rooms.space/make
|
||||
:held rooms.held/make
|
||||
:inside-cafeteria rooms.inside-cafeteria/make
|
||||
:inside-antique rooms.inside-antique/make
|
||||
:inside-jail rooms.inside-jail/make
|
||||
:dream rooms.dream/make
|
||||
:ending rooms.ending/make
|
||||
:castle-gate rooms.castle-gate/make
|
||||
:outside-jail rooms.outside-jail/make
|
||||
:outside-castle rooms.outside-castle/make }
|
||||
;; TODO RE ADD
|
||||
#_#_rooms (add-georgia-to-all-rooms screen rooms)
|
||||
entities {:rooms rooms
|
||||
:step-particles (assoc (particle-effect "particles/step") :x 100 :y 100 :baseline 241)
|
||||
:cam {:zoom utils/min-zoom
|
||||
@@ -1298,7 +1301,7 @@
|
||||
:all-items (assoc items/items :object nil)
|
||||
:started? {:value false
|
||||
:object nil}
|
||||
:room (as-> (get rooms (:last-room state)) room
|
||||
:room (as-> ((get rooms (:last-room state)) screen) room
|
||||
(assoc-in room [:entities :ego] (get-ego screen global-atlas (if has-start-pos?
|
||||
start-pos
|
||||
(:start-pos room))
|
||||
|
||||
Reference in New Issue
Block a user