better sheep.

This commit is contained in:
2015-02-22 09:10:43 -08:00
parent 5a91c7fc2f
commit 6becca7191

View File

@@ -235,7 +235,8 @@
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))]
cauldron (utils/make-anim "outsidehouse/cauldron.png" [50 38] 0.15 (range 4))
scaler (utils/scaler-fn-with-baseline 110 0.10 1.00)]
(rooms/make :music {:day :town-2 :night :night}
:interactions
{:door {:box [258 100 281 160]
@@ -277,16 +278,18 @@
:cursor :left}}
:layers {:day [(assoc (texture "outsidehouse/background.png") :x 0 :y 0 :baseline 0)
(assoc (texture "outsidehouse/house.png") :x 0 :y 0 :baseline 122)
(assoc (texture "outsidehouse/fence.png") :x 0 :y 0 :baseline 95)
(assoc (texture "outsidehouse/fence.png") :x 0 :y 0 :baseline 93)
(assoc (texture "outsidehouse/background-trees.png") :x 0 :y 0 :baseline 44)]
:night [(assoc (texture "outsidehouse/background-dark.png") :x 0 :y 0 :baseline 0)
(assoc (texture "outsidehouse/house-dark.png") :x 0 :y 0 :baseline 122)
(assoc (texture "outsidehouse/fence-dark.png") :x 0 :y 0 :baseline 95)
(assoc (texture "outsidehouse/fence-dark.png") :x 0 :y 0 :baseline 93)
(assoc (texture "outsidehouse/background-trees-dark.png") :x 0 :y 0 :baseline 44)]}
:entities {:sheep (actions/start-animation screen
(assoc (animation->texture screen sheep-stand) :x 38 :y 160 :baseline 160
(assoc (animation->texture screen sheep-stand) :x 38 :y 160 :baseline 80
:scale-x (scaler [38 160])
:scale-y (scaler [38 160])
:box [38 160 71 181]
:script (actions/get-script
entities
@@ -310,7 +313,7 @@
:carrot (actions/get-script entities
(actions/walk-to entities :ego ego-sheep-loc :face :left)
(actions/talk entities :ego "Come on girl, get the carrot!")
(actions/walk-straight-to entities :sheep [95 150])
(actions/walk-straight-to entities :sheep [90 138] :update-baseline? false)
(actions/play-animation entities :ego :reach)
(actions/remove-item entities :carrot)
(actions/update-state entities (fn [s] (assoc s :coaxed-sheep? true))))
@@ -333,7 +336,9 @@
:left {:walk (utils/flip sheep-walk)
:stand (utils/flip sheep-stand)}
:right {:walk sheep-walk
:stand sheep-stand})
:stand sheep-stand}
:scaled true
)
sheep-stand)
:butterfly (assoc (animation->texture screen butterfly-stand)
:x 161
@@ -365,11 +370,11 @@
(actions/give entities :note-1)
(common/read-note-1 entities))))
:collision "outsidehouse/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00)
:scale-fn scaler
:apply-state (fn [entities]
(as-> entities entities
(if (get-in entities [:state :coaxed-sheep?])
(update-in entities [:room :entities :sheep] #(assoc % :x 95 :y 150 :baseline 40))
(update-in entities [:room :entities :sheep] #(assoc % :x 90 :y 138 :baseline 40))
entities)
(if (= :night (get-in entities [:state :time]))
(make-night entities)