outsidehouse

This commit is contained in:
Bryce Covert
2017-05-28 06:27:36 -07:00
parent 7fc4f11a60
commit ad38708873
160 changed files with 548 additions and 169 deletions

View File

@@ -27,13 +27,13 @@
:time time)
(actions/play-animation entities :ego :standup))
(defn make-wizard [screen wizard-spec]
(let [wizard-sheet (texture! (utils/get-texture "wizard/talk.png") :split 20 46)
(defn make-wizard [screen atlas wizard-spec]
(let [wizard-sheet (texture! (utils/atlas->texture atlas "wizard/talk") :split 20 46)
wizard-stand (animation 0.2 (for [i (flatten [(repeat 10 0) 1])]
(aget wizard-sheet 0 i)))
wizard-talk-angry (utils/make-anim "wizard/talk-angry.png" [20 50] 0.2 [0 2 0 2 1 2 0 3 0 2 0 1 0 2])
wizard-magic-hands (utils/make-anim "wizard/magic-hands.png" [20 50] 0.2 (range 2))
wizard-disappear (utils/make-anim "wizard/disappear.png" [20 46] 0.075 (range 19))
wizard-talk-angry (utils/make-anim atlas "wizard/talk-angry" [20 50] 0.2 [0 2 0 2 1 2 0 3 0 2 0 1 0 2])
wizard-magic-hands (utils/make-anim atlas "wizard/magic-hands" [20 50] 0.2 (range 2))
wizard-disappear (utils/make-anim atlas "wizard/disappear" [20 46] 0.075 (range 19))
disappear-left (utils/flip wizard-disappear)
wizard-talk (animation 0.2 (for [i [0 2 0 2 1 2 0 3 0 2 0 1 0 2]]
(aget wizard-sheet 0 i)))

View File

@@ -604,6 +604,7 @@
(defn make [screen]
(let [[screen atlas] (utils/acquire-atlas screen "packed/outsidehouse.atlas")
[screen global-atlas] (utils/acquire-atlas screen "packed/global.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)
@@ -615,7 +616,7 @@
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])
butterfly-stand (utils/make-anim atlas "butterfly" [7 7] 0.1 [0 1])
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)
@@ -677,20 +678,20 @@
entities
(walk-to-castle entities))
:cursor :left}}
:layers {:day [(assoc (utils/get-texture "outsidehouse/background.png") :x 0 :y 0 :baseline 0)
(assoc (utils/get-texture "outsidehouse/house.png") :x 0 :y 0 :baseline 122)
(assoc (utils/get-texture "outsidehouse/fence.png") :x 0 :y 0 :baseline 93)
:layers {:day [(assoc (utils/atlas->texture atlas "background") :x 0 :y 0 :baseline 0)
(assoc (utils/atlas->texture atlas "house") :x 0 :y 0 :baseline 122)
(assoc (utils/atlas->texture atlas "fence") :x 0 :y 0 :baseline 93)
(assoc (utils/get-texture "outsidehouse/background-trees.png") :x 0 :y 0 :baseline 44)
(assoc (utils/get-texture "outsidehouse/fg1.png") :x 0 :y 0 :baseline 1000 :parallax 1.5)
(assoc (utils/get-texture "outsidehouse/fg2.png") :x (- 320 55) :y 0 :baseline 1000 :parallax 1.5)]
:night [(assoc (utils/get-texture "outsidehouse/background.png") :x 0 :y 0 :baseline 0)
(assoc (utils/get-texture "outsidehouse/house.png") :x 0 :y 0 :baseline 122)
(assoc (utils/get-texture "outsidehouse/fence.png") :x 0 :y 0 :baseline 93)
(assoc (utils/atlas->texture atlas "background-trees") :x 0 :y 0 :baseline 44)
(assoc (utils/atlas->texture atlas "fg1") :x 0 :y 0 :baseline 1000 :parallax 1.5)
(assoc (utils/atlas->texture atlas "fg2") :x (- 320 55) :y 0 :baseline 1000 :parallax 1.5)]
:night [(assoc (utils/atlas->texture atlas "background") :x 0 :y 0 :baseline 0)
(assoc (utils/atlas->texture atlas "house") :x 0 :y 0 :baseline 122)
(assoc (utils/atlas->texture atlas "fence") :x 0 :y 0 :baseline 93)
(assoc (utils/get-texture "outsidehouse/background-trees.png") :x 0 :y 0 :baseline 44)
(assoc (utils/get-texture "outsidehouse/fg1.png") :x 0 :y 0 :baseline 1000 :parallax 1.5)
(assoc (utils/get-texture "outsidehouse/fg2.png") :x (- 320 55) :y 0 :baseline 1000 :parallax 1.5)]}
(assoc (utils/atlas->texture atlas "background-trees") :x 0 :y 0 :baseline 44)
(assoc (utils/atlas->texture atlas "fg1") :x 0 :y 0 :baseline 1000 :parallax 1.5)
(assoc (utils/atlas->texture atlas "fg2") :x (- 320 55) :y 0 :baseline 1000 :parallax 1.5)]}
:entities {:sheep (actions/start-animation screen
(assoc (animation->texture screen sheep-stand) :x 38 :y 160 :baseline 80
[:stand 1] sheep-1
@@ -796,7 +797,7 @@
:door-sound (utils/load-sound "door.ogg")
:anim-sound-frames {door {1 [:door-sound 0.1]}}
)
:lamb (assoc (utils/get-texture "outsidehouse/lamb.png")
:lamb (assoc (utils/atlas->texture atlas "lamb")
:cursor :look
:label "Baby lamb"
:x 10 :y 163 :baseline 77
@@ -853,13 +854,13 @@
(actions/talk entities :ego "It's a small, sharp piece of charcoal.")
)
))
:wizard (rooms/make-entity :wizard (common/make-wizard screen {:x 190 :y 78 :baseline 162 :scale-x 1.2 :scale-y 1.2
:wizard (rooms/make-entity :wizard (common/make-wizard screen global-atlas {:x 190 :y 78 :baseline 162 :scale-x 1.2 :scale-y 1.2
:script (actions/get-script entities (talk-to-gandarf-outside entities))
:scripts {:default (actions/get-script entities (actions/talk entities :wizard "No time for that!"))
:sword (actions/get-script entities (actions/do-dialogue entities
:wizard "The Sword of Blergh!"
:wizard "Good job, Tick."))}}))
:note (rooms/make-entity :note (assoc (utils/get-texture "outsidehouse/note.png")
:note (rooms/make-entity :note (assoc (utils/atlas->texture atlas "note")
:x 277 :y 74 :baseline 160
:label "Paper airplane"
:cursor :hand