simplified wind.

This commit is contained in:
Bryce Covert
2015-10-08 15:51:46 -07:00
parent 2ff70ff209
commit cae1ca9aed
3 changed files with 16 additions and 16 deletions

View File

@@ -242,7 +242,7 @@
:ego "But..."
:fairy-godfather "No buts.")
(utils/snapshot-state @entities :beginning)
(actions/update-state entities #(assoc % :seen-intro? true)))
(actions/update-state entities #(assoc % :seen-intro? true :time :day)))
(defn swing [entities]
(actions/run-action entities
@@ -341,7 +341,7 @@
(defn make [screen]
(let [fairy-godfather-anim (utils/make-anim "dream/fairy-godfather.png" [63 77] 0.15 [0 1 2 3 2 1 0 1 4 3 2 1])
fairy-godfather-talk-anim (utils/make-anim "dream/fairy-godfather.png" [63 77] 0.15 [5 6 7 8 7 6])]
(rooms/make :music :dream
(rooms/make :music {:intro :wind :day :dream}
:interactions {:pit {:box [54 0 219 36]
:script (actions/get-script entities
(actions/walk-to entities :ego [154 41])
@@ -376,8 +376,7 @@
(assoc (utils/get-texture "dream/corner-l.png") :x -10 :y -10 :baseline 240 :parallax 2.0 )
(assoc (utils/get-texture "dream/corner-r.png") :x (- 320 80) :y -20 :baseline 240 :parallax 3.2)
(assoc (utils/get-texture "dream/pedestals.png") :x 0 :y 0 :baseline 139)]
:wind-sound {:sound (utils/load-sound "dream/wind.ogg")
:id nil}
:entities {:magic (assoc (particle-effect "particles/dream-magic") :x 160 :y 80 :baseline 240)
:clouds (assoc (particle-effect "particles/cloudy2") :x 160 :y 120 :baseline 241)
@@ -488,10 +487,7 @@
(actions/play-animation entities :ego :sigh))})}
:collision "dream/collision.png"
:scale-fn (utils/scaler-fn-from-image "dream/scale.png" 0.1 1.3)
:stop-fn (fn [_ entities]
(when-let [wind-sound-id (get-in entities [:room :wind-sound :id])]
(sound! (get-in entities [:room :wind-sound :sound]) :stop wind-sound-id))
entities)
:apply-state (fn [_ entities]
(utils/fast-forward-particle (get-in entities [:room :entities :outside-particles]))
@@ -504,6 +500,5 @@
entities)
(if (actions/has-item? entities :shovel)
(update-in entities [:room :entities] dissoc :shovel)
entities)
(assoc-in entities [:room :wind-sound :id] (sound! (get-in entities [:room :wind-sound :sound]) :loop 0.2))))
entities)))
:start-pos [140 55])))

View File

@@ -521,7 +521,7 @@ void main()
choose-step-sound (fn [entities]
(if (#{:inside-house :inside-stash :inside-cafeteria :inside-antique :inside-jail}
(get-in entities [:state :last-room]))
:blink
(rand-nth [:inside-step-sound-1 :inside-step-sound-2 :inside-step-sound-3 :inside-step-sound-4])
(rand-nth [:step-sound-1 :step-sound-2 :step-sound-3 :step-sound-4])))
@@ -634,6 +634,11 @@ void main()
:step-sound-2 (utils/load-sound "ego/step-2.ogg")
:step-sound-3 (utils/load-sound "ego/step-3.ogg")
:step-sound-4 (utils/load-sound "ego/step-4.ogg")
:inside-step-sound-1 (utils/load-sound "ego/inside-step-1.ogg")
:inside-step-sound-2 (utils/load-sound "ego/inside-step-2.ogg")
:inside-step-sound-3 (utils/load-sound "ego/inside-step-3.ogg")
:inside-step-sound-4 (utils/load-sound "ego/inside-step-4.ogg")
:sigh-sound (utils/load-sound "ego/sigh.ogg")
:breakglass-sound (utils/load-sound "ego/breakglass.ogg")
:idea-sound (utils/load-sound "ego/idea.ogg")
@@ -784,7 +789,7 @@ void main()
{:object nil
:active? true
:last-room :dream
:time :day
:time :intro
:obtained-items #{}
:inventory []
:plaques-read #{}
@@ -795,8 +800,7 @@ void main()
(defn fade-in-first-time-if-necessary [screen entities]
(if (not (get-in entities [:started? :value]))
(do (music! (utils/get-current-music entities) :set-volume (utils/current-music-volume (get-in entities [:volume :value])))
(when (get-in entities [:state :seen-intro?])
(utils/play-music (get-in entities [:musics (actions/get-music (get-in entities [:room :music]) (get-in entities [:state :time]))])))
(utils/play-music (get-in entities [:musics (actions/get-music (get-in entities [:room :music]) (get-in entities [:state :time]))]))
(assoc entities
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0 :ease tween/ease-in-cubic
:finish #(if (not (get-in % [:state :seen-intro?]))
@@ -894,7 +898,7 @@ void main()
(defn get-rendered [entities e]
(merge e
(when (not= :day (get-in entities [:state :time]))
(when (= :night (get-in entities [:state :time]))
(get-in entities [:time-profiles (:night-profile e :default)]))))
@@ -970,7 +974,8 @@ void main()
:pull-sword (utils/make-music "music/pull-sword.ogg")
:night (utils/make-music "music/night.ogg")
:dream (utils/make-music "dream/music.ogg")
:secret-hideout (utils/make-music "music/secret-hideout.ogg")}
:secret-hideout (utils/make-music "music/secret-hideout.ogg")
:wind (utils/make-music "music/wind.ogg")}
:state (get-state @utils/selected-save)
:time-profiles {:object nil
:default utils/default-night-merge