cat tree uses atlas.
This commit is contained in:
@@ -243,26 +243,27 @@
|
||||
(actions/add-entity entities :blank (get-in @entities [:room :blank])))}})
|
||||
|
||||
(defn make [screen]
|
||||
(let [cat-stand-sheet (texture! (utils/get-texture "cat-tree/cat-stand.png") :split 22 10)
|
||||
(let [[screen atlas] (utils/acquire-atlas screen "packed/cat-tree.atlas")
|
||||
cat-stand-sheet (texture! (utils/atlas->texture atlas "cat-stand") :split 22 10)
|
||||
cat-stand (animation 0.15 (for [i (flatten [(repeat 10 0) 1 1 (repeat 10 0) 2 3 4 3 0 0 2 3 4 3 (repeat 10 0) 1 1 (repeat 10 0) 5 5 6 6 7 (repeat 10 [7 8]) 6 5 0])]
|
||||
(aget cat-stand-sheet 0 i)))
|
||||
cat-walk (animation 0.2 [(utils/get-texture "cat-tree/pounce.png")])
|
||||
destroy-ladder (utils/make-anim "cat-tree/destroy-ladder.png" [29 38] 0.1 (range 18))
|
||||
ladder-entity (assoc (utils/get-texture "inside-cafeteria/ladder.png") :x 130 :y 60 :baseline 162
|
||||
cat-walk (animation 0.2 [(utils/atlas->texture atlas "pounce")])
|
||||
destroy-ladder (utils/make-anim atlas "destroy-ladder" [29 38] 0.1 (range 18))
|
||||
ladder-entity (assoc (utils/atlas->texture atlas "ladder") :x 130 :y 60 :baseline 162
|
||||
:origin-x 0
|
||||
:destroy-ladder destroy-ladder
|
||||
:ladder-break-sound (utils/load-sound "cat-tree/ladder-break.ogg")
|
||||
:anim-sound-frames {destroy-ladder {4 [:ladder-break-sound 0.6]}})
|
||||
grandma-stand (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1])
|
||||
grandma-squat-1 (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [3 4 5 5 5 5 5])
|
||||
grandma-squat-2 (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [5 5 4 3])
|
||||
grandma-talk (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 2 0 2 0 2 0 2 0 2 0 1 0 2 0 0])
|
||||
grandma-kiss (utils/make-anim "cat-tree/grandma.png" [25 36] 0.2 [0 8 9 10 9 10 9 10 9 8 0])
|
||||
grandma-cry (utils/make-anim-seq "cat-tree/grandma-cry" [58 40] 0.15 (flatten [(range 20) 0 0 0 0 0 0 0 0 0]))
|
||||
owl-stand (utils/make-anim "cat-tree/owl.png" [21 30] 0.2 [0 0 0 0 0 0 0 2])
|
||||
owl-talk (utils/make-anim "cat-tree/owl.png" [21 30] 0.2 [1 0 1 0 1 0 0 0 2 0])
|
||||
owl-puke (utils/make-anim "cat-tree/owl.png" [21 30] 0.10 [0 0 2 2 3 2 2 3 3 2 3 3 3 4 5 6 7 4 4 3 3 2 2 2 2 2])
|
||||
owl-eye (utils/make-anim-seq "cat-tree/eye" [44 48] 0.10 [0 0 1 1 2 2 2 2 2 2 2 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 3 4 4 4 3 4 4 4 5 6 7 8 9 9 9 9 9 9 9 9 9 10 11 12 12 11 10 9 9 9 9 9 9 9 9 10 11 12 12 12 11 10 9 9 9 9 9 8 7 6 5])
|
||||
grandma-stand (utils/make-anim atlas "grandma" [25 36] 0.2 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1])
|
||||
grandma-squat-1 (utils/make-anim atlas "grandma" [25 36] 0.2 [3 4 5 5 5 5 5])
|
||||
grandma-squat-2 (utils/make-anim atlas "grandma" [25 36] 0.2 [5 5 4 3])
|
||||
grandma-talk (utils/make-anim atlas "grandma" [25 36] 0.2 [0 2 0 2 0 2 0 2 0 2 0 1 0 2 0 0])
|
||||
grandma-kiss (utils/make-anim atlas "grandma" [25 36] 0.2 [0 8 9 10 9 10 9 10 9 8 0])
|
||||
grandma-cry (utils/make-anim-seq atlas "grandma-cry" [58 40] 0.15 (flatten [(range 20) 0 0 0 0 0 0 0 0 0]))
|
||||
owl-stand (utils/make-anim atlas "owl" [21 30] 0.2 [0 0 0 0 0 0 0 2])
|
||||
owl-talk (utils/make-anim atlas "owl" [21 30] 0.2 [1 0 1 0 1 0 0 0 2 0])
|
||||
owl-puke (utils/make-anim atlas "owl" [21 30] 0.10 [0 0 2 2 3 2 2 3 3 2 3 3 3 4 5 6 7 4 4 3 3 2 2 2 2 2])
|
||||
owl-eye (utils/make-anim-seq atlas "eye" [44 48] 0.10 [0 0 1 1 2 2 2 2 2 2 2 1 1 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 3 4 4 4 3 4 4 4 5 6 7 8 9 9 9 9 9 9 9 9 9 10 11 12 12 11 10 9 9 9 9 9 9 9 9 10 11 12 12 12 11 10 9 9 9 9 9 8 7 6 5])
|
||||
puke (particle-effect "particles/puke")]
|
||||
(rooms/make :music {:day :town-2 :night :night}
|
||||
:name "Tree"
|
||||
@@ -339,14 +340,14 @@
|
||||
(if (get-in @entities [:room :entities :ladder])
|
||||
(actions/do-stop entities :ego :face :right))))
|
||||
}}
|
||||
:layers {:day [(assoc (utils/get-texture "cat-tree/background.png") :x 0 :y 0 :baseline 0)
|
||||
(assoc (utils/get-texture "cat-tree/tree-and-rock.png") :x 0 :y 0 :baseline 161)
|
||||
(assoc (utils/get-texture "cat-tree/brush-l.png") :x -5 :y -5 :parallax 1.3 :baseline 240)
|
||||
(assoc (utils/get-texture "cat-tree/tree-r.png") :x 270 :y 0 :scale-x 1.1 :scale-y 1.1 :parallax 1.5 :baseline 240)]
|
||||
:night [(assoc (utils/get-texture "cat-tree/background.png") :x 0 :y 0 :baseline 0)
|
||||
(assoc (utils/get-texture "cat-tree/tree-and-rock.png") :x 0 :y 0 :baseline 161)
|
||||
(assoc (utils/get-texture "cat-tree/brush-l.png") :x -5 :y -5 :parallax 1.3 :baseline 240)
|
||||
(assoc (utils/get-texture "cat-tree/tree-r.png") :x 270 :y 0 :scale-x 1.1 :scale-y 1.1 :parallax 1.5 :baseline 240)]}
|
||||
:layers {:day [(assoc (utils/atlas->texture atlas "background.png") :x 0 :y 0 :baseline 0)
|
||||
(assoc (utils/atlas->texture atlas "tree-and-rock.png") :x 0 :y 0 :baseline 161)
|
||||
(assoc (utils/atlas->texture atlas "brush-l.png") :x -5 :y -5 :parallax 1.3 :baseline 240)
|
||||
(assoc (utils/atlas->texture atlas "tree-r.png") :x 270 :y 0 :scale-x 1.1 :scale-y 1.1 :parallax 1.5 :baseline 240)]
|
||||
:night [(assoc (utils/atlas->texture atlas "background.png") :x 0 :y 0 :baseline 0)
|
||||
(assoc (utils/atlas->texture atlas "tree-and-rock.png") :x 0 :y 0 :baseline 161)
|
||||
(assoc (utils/atlas->texture atlas "brush-l.png") :x -5 :y -5 :parallax 1.3 :baseline 240)
|
||||
(assoc (utils/atlas->texture atlas "tree-r.png") :x 270 :y 0 :scale-x 1.1 :scale-y 1.1 :parallax 1.5 :baseline 240)]}
|
||||
:entities {
|
||||
:outside-particles (common/make-outside-particles)
|
||||
:cat (actions/start-animation screen
|
||||
|
||||
Reference in New Issue
Block a user