another room with own textures.

This commit is contained in:
Bryce Covert
2017-05-28 10:29:58 -07:00
parent 7d4e93a964
commit 62112a9378

View File

@@ -327,19 +327,20 @@
(actions/give entities :slobber))
(defn make [screen]
(let [peddler-sheet (texture! (utils/get-texture "outside-castle/peddler-talk.png" ) :split 18 36)
(let [[screen atlas] (utils/acquire-atlas screen "packed/outside-castle.atlas")
peddler-sheet (texture! (utils/atlas->texture atlas "peddler-talk" ) :split 18 36)
peddler-talk (animation 0.18 (for [i (flatten [2 3 2 3 2 3 6 1 0 1 0 1 0 1 0 1 2 3 2 3 2 3 6 4 5 4 5 4 5 4 5])]
(aget peddler-sheet 0 i)))
peddler-stand (animation 0.2 (for [i (flatten [(repeat 8 0) 6 (repeat 15 0) 6 (repeat 5 0) 4 5 4 5 4 5 (repeat 10 0)] )]
(aget peddler-sheet 0 i)))
balloon-sheet (texture! (utils/get-texture "outside-castle/balloons.png") :split 20 36)
balloon-sheet (texture! (utils/atlas->texture atlas "balloons") :split 20 36)
balloon-stand (animation 0.25 (for [i [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 0 1 2 1 0 1 2 1 0 1 2 1 0 1 2]]
(aget balloon-sheet 0 i)))
steer-sheet (texture! (utils/get-texture "outside-castle/steer.png") :split 50 35)
steer-sheet (texture! (utils/atlas->texture atlas "steer") :split 50 35)
steer-stand (animation 0.2 (for [i [0 0 0 0 0 0 0 0 0 1 0 2 0 1 0 2 0 1 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3 3 3 3 3 3 3 3 0 0 0 0]]
(aget steer-sheet 0 i)))
flies-stand (utils/make-anim "outside-castle/flies.png" [21 21] 0.075 (flatten (repeat 2 [0 1 2 1])))]
flies-stand (utils/make-anim atlas "flies" [21 21] 0.075 (flatten (repeat 2 [0 1 2 1])))]
(rooms/make :music {:day :town-2 :night :night :sunrise :night}
:name "Outside castle"
:interactions
@@ -381,23 +382,23 @@
(actions/give entities :carrot))))}}
:flies-sound {:sound (utils/load-sound "outside-castle/flies2.ogg")
:id nil}
:layers {:day [(assoc (utils/get-texture "outside-castle/background.png") :x 0 :y 0 :baseline 0)
(assoc (utils/get-texture "outside-castle/blanket.png") :x 60 :y (- 240 173) :baseline 1)
(assoc (utils/get-texture "outside-castle/brush-bl.png") :origin-x 25 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 25 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/get-texture "outside-castle/brush-br.png") :origin-x 88 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 315 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/get-texture "outside-castle/walk-behind.png") :x 0 :y 0 :baseline 69)]
:night [(assoc (utils/get-texture "outside-castle/background.png") :x 0 :y 0 :baseline 0)
:layers {:day [(assoc (utils/atlas->texture atlas "background") :x 0 :y 0 :baseline 0)
(assoc (utils/atlas->texture atlas "blanket") :x 60 :y (- 240 173) :baseline 1)
(assoc (utils/atlas->texture atlas "brush-bl") :origin-x 25 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 25 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/atlas->texture atlas "brush-br") :origin-x 88 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 315 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/atlas->texture atlas "walk-behind") :x 0 :y 0 :baseline 69)]
:night [(assoc (utils/atlas->texture atlas "background") :x 0 :y 0 :baseline 0)
(assoc (utils/get-texture "outside-castle/brush-bl.png") :origin-x 25 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 25 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/get-texture "outside-castle/brush-br.png") :origin-x 88 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 315 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/get-texture "outside-castle/walk-behind.png") :x 0 :y 0 :baseline 69)]
:sunrise [(assoc (utils/get-texture "outside-castle/background.png") :x 0 :y 0 :baseline 0)
(assoc (utils/atlas->texture atlas "brush-bl") :origin-x 25 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 25 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/atlas->texture atlas "brush-br") :origin-x 88 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 315 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/atlas->texture atlas "walk-behind") :x 0 :y 0 :baseline 69)]
:sunrise [(assoc (utils/atlas->texture atlas "background") :x 0 :y 0 :baseline 0)
(assoc (utils/get-texture "outside-castle/brush-bl.png") :origin-x 25 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 25 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/get-texture "outside-castle/brush-br.png") :origin-x 88 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 315 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/get-texture "outside-castle/walk-behind.png") :x 0 :y 0 :baseline 69)]}
(assoc (utils/atlas->texture atlas "brush-bl") :origin-x 25 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 25 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/atlas->texture atlas "brush-br") :origin-x 88 :origin-y 20 :scale-x 1.0 :scale-y 1.0 :x 315 :y 0 :baseline 240 :parallax 1.2)
(assoc (utils/atlas->texture atlas "walk-behind") :x 0 :y 0 :baseline 69)]}
:entities {:peddler (actions/start-animation screen
(assoc (utils/get-texture "outside-castle/peddler.png") :x 110 :y 90 :baseline 150 :anim nil
(assoc (utils/atlas->texture atlas "peddler") :x 110 :y 90 :baseline 150 :anim nil
:anim-sound-frames {peddler-stand {8 [:blink 0.3 0.8]
24 [:blink 0.3 0.8]
30 [:scratch 0.15]}
@@ -503,7 +504,7 @@
:script (actions/get-script entities
(actions/talk entities :ego "Those flies seem to be attracted to Angus' stench."))
)}
:note (rooms/make-entity :note (assoc (utils/get-texture "outside-castle/note.png")
:note (rooms/make-entity :note (assoc (utils/atlas->texture atlas "note")
:label "Bingo card"
:cursor :hand
:x 198 :y 66 :baseline 174