diff --git a/desktop/gametodos.txt b/desktop/gametodos.txt index 58e03943..aa6acd77 100644 --- a/desktop/gametodos.txt +++ b/desktop/gametodos.txt @@ -7,6 +7,5 @@ + fight with blergh at end isn't great + ending + secret lever -+ shopkeep sigh + proper save/settings file location + closing should stop all scripts diff --git a/desktop/resources/outside-castle/flies.wav b/desktop/resources/outside-castle/flies.wav old mode 100644 new mode 100755 index 21746f02..0af21657 Binary files a/desktop/resources/outside-castle/flies.wav and b/desktop/resources/outside-castle/flies.wav differ diff --git a/desktop/resources/outside-castle/flies2.ogg b/desktop/resources/outside-castle/flies2.ogg new file mode 100644 index 00000000..0ceda128 Binary files /dev/null and b/desktop/resources/outside-castle/flies2.ogg differ diff --git a/desktop/resources/outside-castle/flies2.wav b/desktop/resources/outside-castle/flies2.wav new file mode 100644 index 00000000..f38e4f4e Binary files /dev/null and b/desktop/resources/outside-castle/flies2.wav differ diff --git a/desktop/resources/outside-castle/flies_1.wav b/desktop/resources/outside-castle/flies_1.wav deleted file mode 100644 index 29c22295..00000000 Binary files a/desktop/resources/outside-castle/flies_1.wav and /dev/null differ diff --git a/desktop/src-common/advent/screens/rooms/outside_castle.clj b/desktop/src-common/advent/screens/rooms/outside_castle.clj index ceb4881d..3ef1e548 100644 --- a/desktop/src-common/advent/screens/rooms/outside_castle.clj +++ b/desktop/src-common/advent/screens/rooms/outside_castle.clj @@ -12,6 +12,10 @@ [play-clj.math :refer :all] [play-clj.g2d :refer :all])) + +(defn flies-vol [entities] + (utils/proximity-volume entities [201 175] :scale 0.5)) + (defn do-initial-peddler-conversation [entities] (actions/do-dialogue entities :ego "Hello there, peddler." @@ -302,6 +306,8 @@ (actions/play-animation entities :ego :squat) (actions/talk entities :ego "No one will notice one missing.") (actions/give entities :carrot))))}} + :flies-sound {:sound (sound "outside-castle/flies2.ogg") + :id nil} :layers {:day [(assoc (texture "outside-castle/background.png") :x 0 :y 0 :baseline 0) (assoc (texture "outside-castle/blanket.png") :x 60 :y (- 240 173) :baseline 1) (assoc (texture "outside-castle/brush.png") :origin-x 0 :origin-y 0 :scale-x 1.0 :scale-y 1.0 :x 15 :y 0 :baseline 240 :parallax 1.2) @@ -389,7 +395,6 @@ :anim flies-stand :anim-start 0 :baseline 240 - :sound (sound "outside-castle/flies.ogg") :scripts {:sack-lunch (actions/get-script entities (actions/walk-to entities :ego [168 150] :face :right) (actions/talk entities :ego "Maybe I can catch some of these flies.") @@ -399,7 +404,7 @@ (actions/play-animation entities :ego :squat) (actions/give entities :flies) (actions/talk entities :ego "Hopefully they won't fly out of my backpack."))} - :anim-sound-frames {flies-stand {0 [:sound 0.33]}})} + )} :note (rooms/make-entity :note (assoc (texture "outside-castle/note.png") :x 198 :y 66 :baseline 174 :script (actions/get-script entities @@ -413,6 +418,20 @@ :start-pos [259 80] :apply-state (fn [_ entities] (utils/fast-forward-particle (get-in entities [:room :entities :outside-particles])) - (if (#{:night :sunrise} (get-in entities [:state :time])) - (make-night entities) - entities))))) + (-> + (if (#{:night :sunrise} (get-in entities [:state :time])) + (make-night entities) + entities) + (assoc-in [:room :flies-sound :id] (sound! (get-in entities [:room :flies-sound :sound]) :loop (flies-vol entities))))) + + :update-fn (fn [_ entities] + (when-let [flies-sound-id (get-in entities [:room :flies-sound :id])] + (sound! (get-in entities [:room :flies-sound :sound]) :set-volume flies-sound-id (flies-vol entities))) + entities) + + :stop-fn (fn [_ entities] + (when-let [flies-sound-id (get-in entities [:room :flies-sound :id])] + (sound! (get-in entities [:room :flies-sound :sound]) :stop flies-sound-id)) + entities) + + ))) diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index 6c8afd57..bf75b96e 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -1010,8 +1010,8 @@ void main() :on-render (fn [screen [entities]] (let [entities (utils/apply-tweens screen entities (:tweens entities))] - #_(label! (:fps entities) :set-text (str (game :fps))) - (render! screen [#_(:fps entities) (:inventory entities) (:close entities)]) + (label! (:fps entities) :set-text (str (game :fps))) + (render! screen [(:fps entities) (:inventory entities) (:close entities)]) entities)) :on-resize