correct cursor logic, scared animation update, choosable volume.
This commit is contained in:
@@ -34,51 +34,46 @@
|
||||
(defscreen title-screen
|
||||
:on-show
|
||||
(fn [screen entities]
|
||||
(let [cam (orthographic)
|
||||
viewport (FitViewport. 1280 960 cam)]
|
||||
(utils/load-settings!)
|
||||
(update! screen :renderer (stage) :camera cam :viewport viewport)
|
||||
(.apply viewport)
|
||||
(let [font (utils/get-font "ego/font.fnt")
|
||||
start-playing (assoc (label "Embark on thy adventure" (style :label font (color 0.6 1.0 1.0 1.0))) :x 0 :y 100)
|
||||
start-playing (center start-playing)
|
||||
quit (assoc (label "Quit thy adventure" (style :label font (color 0.6 1.0 1.0 1.0))) :x 0 :y 50)
|
||||
quit (center quit)
|
||||
music (utils/make-music "intro.ogg")
|
||||
ui-skin (skin "ui/ui.json")]
|
||||
(label! start-playing :set-alignment Align/center)
|
||||
|
||||
{:overlay (assoc (texture "title-overlay.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0)
|
||||
:fade (assoc (texture "black.png")
|
||||
:scale-x 80
|
||||
:scale-y 80
|
||||
:opacity 1.0)
|
||||
:music-volume-slider (assoc (slider {:min 0 :max 100 :step 1} ui-skin :set-value (:music-volume @utils/settings))
|
||||
:x ( - (/ (game :width) 2)
|
||||
150)
|
||||
:width 300
|
||||
:y 200)
|
||||
:sound-volume-slider (assoc (slider {:min 0 :max 100 :step 1 } ui-skin :set-value (:sound-volume @utils/settings))
|
||||
:width 300
|
||||
:x ( - (/ (game :width) 2)
|
||||
150)
|
||||
:y 150)
|
||||
:viewport viewport
|
||||
:font font
|
||||
:music music
|
||||
:volume 1.0
|
||||
:start-showing? false
|
||||
:start-playing start-playing
|
||||
:quit quit
|
||||
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0
|
||||
:finish #(do (utils/play-sound (:music %)) %)
|
||||
:ease tween/ease-in-quadratic)}})))
|
||||
|
||||
(utils/setup-viewport screen 1280 960)
|
||||
(utils/load-settings!)
|
||||
(let [font (utils/get-font "ego/font.fnt")
|
||||
start-playing (assoc (label "Embark on thy adventure" (style :label font (color 0.6 1.0 1.0 1.0))) :x 0 :y 100)
|
||||
start-playing (center start-playing)
|
||||
quit (assoc (label "Quit thy adventure" (style :label font (color 0.6 1.0 1.0 1.0))) :x 0 :y 50)
|
||||
quit (center quit)
|
||||
music (utils/make-music "intro.ogg")
|
||||
ui-skin (skin "ui/ui.json")]
|
||||
(label! start-playing :set-alignment Align/center)
|
||||
|
||||
{:overlay (assoc (texture "title-overlay.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0)
|
||||
:fade (assoc (texture "black.png")
|
||||
:scale-x 80
|
||||
:scale-y 80
|
||||
:opacity 1.0)
|
||||
:music-volume-slider (assoc (slider {:min 0 :max 100 :step 1} ui-skin :set-value (:music-volume @utils/settings))
|
||||
:x ( - (/ (game :width) 2)
|
||||
150)
|
||||
:width 300
|
||||
:y 200)
|
||||
:sound-volume-slider (assoc (slider {:min 0 :max 100 :step 1 } ui-skin :set-value (:sound-volume @utils/settings))
|
||||
:width 300
|
||||
:x ( - (/ (game :width) 2)
|
||||
150)
|
||||
:y 150)
|
||||
|
||||
:font font
|
||||
:music music
|
||||
:volume 1.0
|
||||
:start-showing? false
|
||||
:start-playing start-playing
|
||||
:quit quit
|
||||
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0
|
||||
:finish #(do (utils/play-sound (:music %)) %)
|
||||
:ease tween/ease-in-quadratic)}}))
|
||||
|
||||
:on-render
|
||||
(fn [screen [entities]]
|
||||
(.update (:camera screen))
|
||||
(.apply (:viewport screen))
|
||||
|
||||
|
||||
(clear!)
|
||||
(let [entities (utils/apply-tweens screen entities (:tweens entities))]
|
||||
@@ -129,6 +124,6 @@
|
||||
:else
|
||||
nil)))
|
||||
|
||||
:on-resize (fn [screen [entities]]
|
||||
(.update (:viewport entities) (game :width) (game :height) true)
|
||||
:on-resize (fn [{:keys [viewport width height]} [entities]]
|
||||
(.update viewport width height)
|
||||
nil))
|
||||
|
||||
Reference in New Issue
Block a user