added concept of different background musics.
This commit is contained in:
@@ -153,13 +153,15 @@
|
||||
(defn animate [entity screen]
|
||||
(merge entity (animation->texture (update-in screen [:total-time] #(- % (:anim-start entity)))
|
||||
(:anim entity))))
|
||||
|
||||
(defn play-sound [snd]
|
||||
(sound! snd :loop 0.3))
|
||||
|
||||
(defscreen scene
|
||||
:on-show
|
||||
(fn [screen entities]
|
||||
(update! screen :renderer (stage) :camera (orthographic))
|
||||
(let [_ (input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0)
|
||||
music (sound "town-music.mp3")
|
||||
_ (sound! music :loop 0.30)
|
||||
(let [_ (input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0)
|
||||
rooms {:inside-house (rooms.inside-house/make screen)
|
||||
:outside-house (rooms.outside-house/make screen)
|
||||
:behind-house (rooms.behind-house/make screen)
|
||||
@@ -167,6 +169,10 @@
|
||||
:inside-castle (rooms.inside-castle/make screen)
|
||||
:outside-castle (rooms.outside-castle/make screen)}]
|
||||
{:rooms rooms
|
||||
:musics {:object nil
|
||||
:town-1 (sound "town-music.mp3")
|
||||
:town-2 (doto (sound "town-music-2.mp3") play-sound)
|
||||
:inside-fangald (sound "inside-fangald.mp3")}
|
||||
:state {:object nil
|
||||
:active? true
|
||||
:inventory []}
|
||||
|
||||
Reference in New Issue
Block a user