credits update.

This commit is contained in:
Bryce Covert
2016-04-20 21:48:19 -07:00
parent f723a484e6
commit 8854d740c7
4 changed files with 161 additions and 51 deletions

View File

@@ -10,6 +10,7 @@
[advent.tween :as tween]
[advent.steam :as steam]
[advent.screens.scene :as scene]
[advent.screens.credits :as credits]
[advent.screens.dialogue :as dialogue]
[clojure.tools.logging :as log]
[advent.screens.title :as title]
@@ -353,7 +354,13 @@
:banner-back (assoc (animation->texture (assoc screen :total-time 0.0) banner-back) :x 580 :y 400 :scale-x 4 :scale-y 4
:anim banner-back
:z 3)
:quill (assoc (utils/get-texture "title/quill.png") :x 1150 :y 4 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 10)
:quill (doto (assoc (image-button nil) :x 1150 :y 4 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 10 :key :quill)
(image-button! :add (doto (Group. )
(.addActor (:object (doto (image (utils/get-texture "title/quill.png"))
(image! :set-scale 4))))))
save-object)
:logo (assoc (utils/get-texture "title/logo.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 6)
:fade (assoc (utils/get-texture "black.png")
:scale-x 80
@@ -394,7 +401,7 @@
:font font
:music music
:volume 1.0
:copyright (make-label (str "DEMO - Copyright Bryce Covert - Not for distribution - version " (advent.version/version)) label-color)
:copyright (make-label (str "Copyright Digital Bounce House 2016" (advent.version/version)) label-color)
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0
:finish #(do
@@ -431,12 +438,14 @@
(when (= (key-code :escape) (:key screen))
(utils/toggle-fullscreen!))
nil)
:on-ui-changed
(fn [{:keys [actor] :as screen} [entities]]
(when-not (get-in entities [:tweens :fade-out])
(let [e (-> actor .getUserObject)
actor-key (:key e)]
(println e)
(cond (= :music-volume-slider actor-key)
(do (swap! utils/settings assoc :music-volume (slider! e :get-value))
@@ -447,6 +456,20 @@
(do (swap! utils/settings assoc :sound-volume (slider! e :get-value))
(utils/save-settings!)
entities)
(= :quill actor-key)
(-> entities
(assoc-in [:tweens :fade-out]
(tween/tween :fade-out screen [:fade :opacity] 0.0 1.0 1.0
:finish (fn [entities]
(utils/stop-music (:music entities))
(reset! credits/saved-took? nil)
(set-screen! @(resolve 'advent.core/advent) credits/credits)
entities)
:ease tween/ease-in-cubic))
(assoc-in [:tweens :fade-out-music]
(tween/tween :fade-out-music screen [:volume] 1.0 0.0 1.0)))
(#{:back } actor-key)
(-> entities