This commit is contained in:
2015-05-28 20:17:29 -07:00
53 changed files with 842 additions and 46 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
</array>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
</array>
</plist>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -10,5 +10,25 @@
<key>duration</key> <key>duration</key>
<real>1</real> <real>1</real>
</dict> </dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
</array> </array>
</plist> </plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,276 @@
Untitled
- Delay -
active: false
- Duration -
lowMin: 1000.0
lowMax: 1000.0
- Count -
min: 0
max: 300
- Emission -
lowMin: 0.0
lowMax: 0.0
highMin: 200.0
highMax: 50.0
relative: false
scalingCount: 2
scaling0: 1.0
scaling1: 0.63265306
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Life -
lowMin: 0.0
lowMax: 0.0
highMin: 3000.0
highMax: 3000.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life Offset -
active: false
- X Offset -
active: false
- Y Offset -
active: false
- Spawn Shape -
shape: point
- Spawn Width -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Spawn Height -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Scale -
lowMin: 0.0
lowMax: 0.0
highMin: 32.0
highMax: 32.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Velocity -
active: true
lowMin: 75.0
lowMax: 75.0
highMin: 800.0
highMax: 800.0
relative: false
scalingCount: 3
scaling0: 1.0
scaling1: 0.8979592
scaling2: 0.3877551
timelineCount: 3
timeline0: 0.0
timeline1: 0.11643836
timeline2: 1.0
- Angle -
active: true
lowMin: -90.0
lowMax: -90.0
highMin: 0.0
highMax: 360.0
relative: false
scalingCount: 2
scaling0: 1.0
scaling1: 1.0
timelineCount: 2
timeline0: 0.0
timeline1: 0.4178082
- Rotation -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 3600.0
highMax: -3600.0
relative: false
scalingCount: 2
scaling0: 0.3265306
scaling1: 1.0
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Wind -
active: false
- Gravity -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 3
scaling0: 1.0
scaling1: 1.0
scaling2: 1.0
timelineCount: 3
timeline0: 0.0
timeline1: 0.15068494
timeline2: 0.48630136
- Tint -
colorsCount: 3
colors0: 1.0
colors1: 1.0
colors2: 1.0
timelineCount: 1
timeline0: 0.0
- Transparency -
lowMin: 0.0
lowMax: 0.0
highMin: 1.0
highMax: 1.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Options -
attached: false
continuous: false
aligned: false
additive: false
behind: false
premultipliedAlpha: false
- Image Path -
flesh.png
Untitled
- Delay -
active: false
- Duration -
lowMin: 1000.0
lowMax: 1000.0
- Count -
min: 0
max: 500
- Emission -
lowMin: 0.0
lowMax: 0.0
highMin: 500.0
highMax: 500.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life -
lowMin: 0.0
lowMax: 0.0
highMin: 500.0
highMax: 500.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life Offset -
active: false
- X Offset -
active: false
- Y Offset -
active: false
- Spawn Shape -
shape: point
- Spawn Width -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Spawn Height -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Scale -
lowMin: 0.0
lowMax: 0.0
highMin: 1.0
highMax: 8.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Velocity -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 500.0
highMax: 500.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Angle -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 360.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Rotation -
active: false
- Wind -
active: false
- Gravity -
active: false
- Tint -
colorsCount: 3
colors0: 1.0
colors1: 0.10980392
colors2: 0.03137255
timelineCount: 1
timeline0: 0.0
- Transparency -
lowMin: 0.0
lowMax: 0.0
highMin: 1.0
highMax: 1.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Options -
attached: false
continuous: false
aligned: false
additive: false
behind: false
premultipliedAlpha: false
- Image Path -
dot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,291 @@
Untitled
- Delay -
active: false
- Duration -
lowMin: 300.0
lowMax: 300.0
- Count -
min: 0
max: 300
- Emission -
lowMin: 0.0
lowMax: 0.0
highMin: 400.0
highMax: 50.0
relative: false
scalingCount: 2
scaling0: 1.0
scaling1: 0.63265306
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Life -
lowMin: 0.0
lowMax: 0.0
highMin: 3000.0
highMax: 3000.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life Offset -
active: false
- X Offset -
active: false
- Y Offset -
active: false
- Spawn Shape -
shape: point
- Spawn Width -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Spawn Height -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Scale -
lowMin: 0.0
lowMax: 0.0
highMin: 14.0
highMax: 14.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Velocity -
active: true
lowMin: 75.0
lowMax: 75.0
highMin: 300.0
highMax: 300.0
relative: false
scalingCount: 3
scaling0: 1.0
scaling1: 0.8979592
scaling2: 0.3877551
timelineCount: 3
timeline0: 0.0
timeline1: 0.11643836
timeline2: 1.0
- Angle -
active: true
lowMin: -90.0
lowMax: -90.0
highMin: 0.0
highMax: 360.0
relative: false
scalingCount: 2
scaling0: 1.0
scaling1: 1.0
timelineCount: 2
timeline0: 0.0
timeline1: 0.4178082
- Rotation -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 3600.0
highMax: -3600.0
relative: false
scalingCount: 2
scaling0: 0.3265306
scaling1: 1.0
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Wind -
active: false
- Gravity -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 3
scaling0: 1.0
scaling1: 1.0
scaling2: 1.0
timelineCount: 3
timeline0: 0.0
timeline1: 0.15068494
timeline2: 0.48630136
- Tint -
colorsCount: 3
colors0: 1.0
colors1: 1.0
colors2: 1.0
timelineCount: 1
timeline0: 0.0
- Transparency -
lowMin: 0.0
lowMax: 0.0
highMin: 1.0
highMax: 1.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Options -
attached: false
continuous: false
aligned: false
additive: false
behind: false
premultipliedAlpha: false
- Image Path -
flesh.png
Untitled
- Delay -
active: false
- Duration -
lowMin: 300.0
lowMax: 300.0
- Count -
min: 0
max: 500
- Emission -
lowMin: 0.0
lowMax: 0.0
highMin: 500.0
highMax: 500.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life -
lowMin: 0.0
lowMax: 0.0
highMin: 500.0
highMax: 500.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Life Offset -
active: false
- X Offset -
active: false
- Y Offset -
active: false
- Spawn Shape -
shape: point
- Spawn Width -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Spawn Height -
lowMin: 0.0
lowMax: 0.0
highMin: 0.0
highMax: 0.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Scale -
lowMin: 1.0
lowMax: 1.0
highMin: 5.0
highMax: 3.0
relative: false
scalingCount: 2
scaling0: 1.0
scaling1: 0.0
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Velocity -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 200.0
highMax: 200.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Angle -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: -360.0
highMax: 360.0
relative: false
scalingCount: 2
scaling0: 1.0
scaling1: 1.0
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Rotation -
active: true
lowMin: 0.0
lowMax: 0.0
highMin: 360.0
highMax: -360.0
relative: false
scalingCount: 2
scaling0: 0.0
scaling1: 1.0
timelineCount: 2
timeline0: 0.0
timeline1: 1.0
- Wind -
active: false
- Gravity -
active: false
- Tint -
colorsCount: 3
colors0: 1.0
colors1: 0.101960786
colors2: 0.03137255
timelineCount: 1
timeline0: 0.0
- Transparency -
lowMin: 0.0
lowMax: 0.0
highMin: 1.0
highMax: 1.0
relative: false
scalingCount: 1
scaling0: 1.0
timelineCount: 1
timeline0: 0.0
- Options -
attached: false
continuous: false
aligned: false
additive: false
behind: false
premultipliedAlpha: false
- Image Path -
dot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -1,12 +1,12 @@
ui.png ui.png
size: 32,128 size: 128,64
format: RGBA8888 format: RGBA8888
filter: Nearest,Nearest filter: Nearest,Nearest
repeat: none repeat: none
slider slider
rotate: false rotate: false
xy: 2, 2 xy: 46, 42
size: 20, 20 size: 20, 20
split: 8, 8, 8, 8 split: 8, 8, 8, 8
orig: 20, 20 orig: 20, 20
@@ -14,8 +14,15 @@ slider
index: -1 index: -1
slider-bar slider-bar
rotate: false rotate: false
xy: 2, 24 xy: 2, 2
size: 20, 40 size: 20, 60
orig: 20, 40 orig: 20, 60
offset: 0, 0
index: -1
slider-bar-hover
rotate: false
xy: 24, 2
size: 20, 60
orig: 20, 60
offset: 0, 0 offset: 0, 0
index: -1 index: -1

View File

@@ -2,4 +2,5 @@
com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: { com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: {
default-horizontal: { background: slider, knob: slider-bar } default-horizontal: { background: slider, knob: slider-bar }
default-horizontal-hover: { background: slider, knob: slider-bar-hover }
}} }}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 478 B

View File

@@ -1 +1 @@
{:sound-volume 0.0, :music-volume 0.0} {:sound-volume 86.0, :music-volume 59.0}

View File

@@ -622,8 +622,8 @@
old-music (get-music (get-in entities [:room :music]) (get-in entities [:state :time])) old-music (get-music (get-in entities [:room :music]) (get-in entities [:state :time]))
entities (as-> entities e entities (as-> entities e
(assoc-in e [:room] (get-in entities [:rooms new-background])) (assoc-in e [:room] (get-in entities [:rooms new-background]))
(if between (between screen e) e)
(assoc-in e [:room :entities :ego] ego) (assoc-in e [:room :entities :ego] ego)
(if between (between screen e) e)
(assoc-in e [:state :last-room] new-background) (assoc-in e [:state :last-room] new-background)
(assoc-in e [:tweens :fade-in] (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 time)) (assoc-in e [:tweens :fade-in] (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 time))
(if-not (get-in entities [:cam :paused?]) (if-not (get-in entities [:cam :paused?])

View File

@@ -235,7 +235,7 @@
(actions/do-dialogue entities :ego "I wonder what all of these magic devices do.")))} (actions/do-dialogue entities :ego "I wonder what all of these magic devices do.")))}
:grass {:box [26 105 60 160] :grass {:box [26 105 60 160]
:script (actions/get-script entities :script (actions/get-script entities
(if (not (actions/has-item? entities :grass)) (if (not (actions/has-obtained? entities :grass))
(do (do
(actions/walk-to entities :ego [60 100] :face :left) (actions/walk-to entities :ego [60 100] :face :left)
(actions/play-animation entities :ego :reach) (actions/play-animation entities :ego :reach)

View File

@@ -5,6 +5,7 @@
[advent.screens.items :as items] [advent.screens.items :as items]
[advent.utils :as utils] [advent.utils :as utils]
[advent.pathfind] [advent.pathfind]
[advent.tween :as tween]
[clojure.zip :as zip] [clojure.zip :as zip]
[play-clj.core :refer :all] [play-clj.core :refer :all]
[play-clj.ui :refer :all] [play-clj.ui :refer :all]
@@ -14,7 +15,7 @@
(defn go-to-jail [entities] (defn go-to-jail [entities]
(actions/update-state entities #(assoc % :time :night)) (actions/update-state entities #(assoc % :time :night))
(actions/update-state entities #(assoc % :chest-contents (concat (remove #{:key} (:inventory %)) (:chest-contents %)))) (actions/update-state entities #(assoc % :chest-contents (concat (remove #{:key :ladder} (:inventory %)) (:chest-contents %))))
(actions/update-state entities #(assoc % :inventory [])) (actions/update-state entities #(assoc % :inventory []))
(actions/update-state entities #(assoc % :opened-bars? false)) (actions/update-state entities #(assoc % :opened-bars? false))
(actions/transition-background entities :inside-jail [130 85])) (actions/transition-background entities :inside-jail [130 85]))
@@ -96,6 +97,70 @@
((rand-nth [listen-1 listen-2 listen-3]) entities)) ((rand-nth [listen-1 listen-2 listen-3]) entities))
(defn explode [entities]
(actions/run-action entities
(begin [this screen entities]
(-> entities
(update-in [:room :entities :bloodclot] #(actions/start-animation screen % :explode))
(update-in [:room :entities] dissoc :bloodclot-head)
(assoc-in [:room :entities :ego :facing] :right)
(update-in [:room :entities :ego] #(actions/start-animation screen % :crawl))))
(continue [this screen entities]
(if (= 170 (get-in entities [:room :entities :bloodclot :current-frame-index]))
(particle-effect! (get-in entities [:room :entities :grow-explode]) :start))
(let [move-speed (* 0.17
(/ (:delta-time screen)
(/ 1.0 60.0)))
entities (update-in entities [:room :entities :ego :x] #(max 80 (- % move-speed)))]
(if (= 80 (get-in entities [:room :entities :ego :x]))
(update-in entities [:room :entities :ego] #(actions/start-animation screen % :crawl-hide))
entities )))
(done? [this screen entities]
(= (get-in entities [:room :entities :bloodclot :current-frame-index]) 176))
(terminate [this screen entities]
(-> entities
(update-in [:room :entities] dissoc :bloodclot)
(assoc-in [:tweens :flash] (tween/tween :flash screen [:white-fade :opacity] 0.0 1.0 0.2 :ease tween/ease-in-cubic))))
(can-skip? [this screen entities]
false))
(actions/run-action entities
(begin [this screen entities]
entities)
(continue [this screen entities]
entities)
(done? [this screen entities]
(not (get-in entities [:tweens :flash])))
(terminate [this screen entities]
entities)
(can-skip? [this screen entities]
false))
(actions/run-action entities
(begin [this screen entities]
(assoc-in entities [:tweens :flash] (tween/tween :flash screen [:white-fade :opacity] 1.0 0.0 4.0 :ease tween/ease-in-cubic)))
(continue [this screen entities]
entities)
(done? [this screen entities]
(not (get-in entities [:tweens :flash])))
(terminate [this screen entities]
(update-in entities [:room :entities :ego] dissoc :stand-override))
(can-skip? [this screen entities]
false)))
(defn win [] (defn win []
(actions/get-script entities (actions/get-script entities
(actions/do-dialogue entities (actions/do-dialogue entities
@@ -103,13 +168,17 @@
:ego "I have this potion which will make me as strong as you!" :ego "I have this potion which will make me as strong as you!"
:bloodclot-head "What?!" :bloodclot-head "What?!"
:bloodclot-head "Give it here!") :bloodclot-head "Give it here!")
(actions/transition-background entities :space [200 45]) (actions/transition-background entities :space [200 45] :between (fn [s e]
(-> e
(assoc-in [:room :entities :ego :stand-override] :crawl-stand)
(update-in [:room :entities :ego] #(actions/start-animation s % :crawl-stand)))
))
(actions/do-dialogue entities (actions/do-dialogue entities
:bloodclot-head "Yes!" :bloodclot-head "Yes!"
:bloodclot-head "Ultimate power is mine!" :bloodclot-head "Ultimate power is mine!"
:bloodclot-head "If I drink this entire bottle, I'll be as powerful as a god!") :bloodclot-head "If I drink this entire bottle, I'll be as powerful as a god!")
(actions/remove-entity entities :bloodclot-head)
(explode entities)
#_(particle-effect! (get-in @entities [:room :entities :blowup] ) :start) (actions/play-animation entities :ego :standup)
(actions/play-animation entities :bloodclot :explode) (Thread/sleep 15000)
(Thread/sleep 15000))) ))

View File

@@ -72,6 +72,13 @@
(can-skip? [this screen entities] (can-skip? [this screen entities]
false))) false)))
(defn face-fairy [entities]
(if (< (get-in @entities [:room :entities :fairy-godfather :x])
(get-in @entities [:room :entities :ego :x]))
(actions/do-stop entities :ego :face :left)
(actions/do-stop entities :ego :face :right)))
(defn read-sword-plaque [entities] (defn read-sword-plaque [entities]
(actions/walk-to entities :ego [168 76] :face :left) (actions/walk-to entities :ego [168 76] :face :left)
(actions/talk entities :ego "There's a plaque here.") (actions/talk entities :ego "There's a plaque here.")
@@ -82,9 +89,11 @@
:ego "'Because maidens love guys with might.'" :ego "'Because maidens love guys with might.'"
:ego "Awesome!" :ego "Awesome!"
:ego "If I become a knight, maybe Georgia McGorgeous will love me!") :ego "If I become a knight, maybe Georgia McGorgeous will love me!")
(actions/in-love entities) (when-not (get-in @entities [:state :plaques-read :sword])
(actions/in-love entities))
(actions/stop-walking entities :ego :face :right) (actions/stop-walking entities :ego :face :right)
(when-not (get-in @entities [:room :entities :fairy-godfather :distracted?]) (when-not (get-in @entities [:room :entities :fairy-godfather :distracted?])
(face-fairy entities)
(actions/do-dialogue entities (actions/do-dialogue entities
:fairy-godfather "Tick, I told you that you can't be a knight." :fairy-godfather "Tick, I told you that you can't be a knight."
:fairy-godfather "I think you'd be much better suited for a more menial job." :fairy-godfather "I think you'd be much better suited for a more menial job."
@@ -106,6 +115,7 @@
(actions/play-animation entities :ego :sigh) (actions/play-animation entities :ego :sigh)
(when-not (get-in @entities [:room :entities :fairy-godfather :distracted?]) (when-not (get-in @entities [:room :entities :fairy-godfather :distracted?])
(face-fairy entities)
(actions/talk entities :ego "So can I at least slay ghouls with this broom?") (actions/talk entities :ego "So can I at least slay ghouls with this broom?")
(actions/stop-walking entities :ego :face :left) (actions/stop-walking entities :ego :face :left)
(actions/do-dialogue entities :fairy-godfather "Not quite, young Tick." (actions/do-dialogue entities :fairy-godfather "Not quite, young Tick."
@@ -125,6 +135,7 @@
:ego "'Gals dislike guys who bury souls.'") :ego "'Gals dislike guys who bury souls.'")
(actions/play-animation entities :ego :sigh) (actions/play-animation entities :ego :sigh)
(when-not (get-in @entities [:room :entities :fairy-godfather :distracted?]) (when-not (get-in @entities [:room :entities :fairy-godfather :distracted?])
(face-fairy entities)
(actions/do-dialogue entities (actions/do-dialogue entities
:fairy-godfather "Don't be dismayed, young Tick." :fairy-godfather "Don't be dismayed, young Tick."
:fairy-godfather "Remember, these destinies can't be mistaken." :fairy-godfather "Remember, these destinies can't be mistaken."
@@ -165,24 +176,24 @@
:fairy-godfather "These, young Tick, represent the potential destinies for your life." :fairy-godfather "These, young Tick, represent the potential destinies for your life."
:fairy-godfather "They have been selected since the dawn of time." :fairy-godfather "They have been selected since the dawn of time."
:fairy-godfather "These destinies are never mistaken." :fairy-godfather "These destinies are never mistaken."
:ego "Soo, I've been destined to be a shovel since the dawn of time?" :ego "So, I've been destined to be a shovel since the dawn of time?"
:fairy-godfather "No, no, no!") :fairy-godfather "No, no, no!")
(actions/update-entities entities #(update-in % [:room :entities :fairy-godfather] dissoc :path)) (actions/update-entities entities #(update-in % [:room :entities :fairy-godfather] dissoc :path))
(actions/walk-straight-to entities :fairy-godfather [87 120] :speed 3.0 :update-baseline? false) (actions/walk-straight-to entities :fairy-godfather [87 120] :speed 1.75 :update-baseline? false)
(actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] assoc :path (catmull-rom-spline (map #(apply vector-2* %) [[87 120] [87 124]]) true)))) (actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] assoc :path (catmull-rom-spline (map #(apply vector-2* %) [[87 120] [87 124]]) true))))
(actions/do-dialogue entities :fairy-godfather "This shovel represents the job of grave-digger." (actions/do-dialogue entities :fairy-godfather "This shovel represents the job of grave-digger."
:fairy-godfather "A simple job, for a simple fellow." :fairy-godfather "A simple job, for a simple fellow."
:ego "Hey! " :ego "Hey! "
:ego "I'm not simple.") :ego "I'm not simple.")
(actions/update-entities entities #(update-in % [:room :entities :fairy-godfather] dissoc :path)) (actions/update-entities entities #(update-in % [:room :entities :fairy-godfather] dissoc :path))
(actions/walk-straight-to entities :fairy-godfather [260 120] :speed 3.0 :update-baseline? false) (actions/walk-straight-to entities :fairy-godfather [260 120] :speed 1.75 :update-baseline? false)
(actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] assoc :path (catmull-rom-spline (map #(apply vector-2* %) [[260 120] [260 124]]) true)))) (actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] assoc :path (catmull-rom-spline (map #(apply vector-2* %) [[260 120] [260 124]]) true))))
(actions/do-dialogue entities :fairy-godfather "Next, we have the broom, representing the humble job of a janitor." (actions/do-dialogue entities :fairy-godfather "Next, we have the broom, representing the humble job of a janitor."
:ego "I'm not going to be a janitor!" :ego "I'm not going to be a janitor!"
:ego "I'm going to take the sword and be a knight!" :ego "I'm going to take the sword and be a knight!"
:fairy-godfather "Hmm? Sword?") :fairy-godfather "Hmm? Sword?")
(actions/update-entities entities #(update-in % [:room :entities :fairy-godfather] dissoc :path)) (actions/update-entities entities #(update-in % [:room :entities :fairy-godfather] dissoc :path))
(actions/walk-straight-to entities :fairy-godfather [192 120] :speed 3.0 :update-baseline? false) (actions/walk-straight-to entities :fairy-godfather [192 120] :speed 1.75 :update-baseline? false)
(actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] assoc :path (catmull-rom-spline (map #(apply vector-2* %) [[192 118] [192 124]]) true)))) (actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] assoc :path (catmull-rom-spline (map #(apply vector-2* %) [[192 118] [192 124]]) true))))
(actions/do-dialogue entities (actions/do-dialogue entities
:fairy-godfather "Sword...?" :fairy-godfather "Sword...?"
@@ -249,10 +260,11 @@
:fairy-godfather "Let me go check it out.") :fairy-godfather "Let me go check it out.")
(actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] dissoc :path))) (actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] dissoc :path)))
(actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] assoc :distracted? true))) (actions/update-entities entities (fn [e] (update-in e [:room :entities :fairy-godfather] assoc :distracted? true)))
(actions/walk-straight-to entities :fairy-godfather [211 210] )) (actions/walk-straight-to entities :fairy-godfather [211 210] :face :left))
(defn talk-to-fairy [entities] (defn talk-to-fairy [entities]
(do (do
(face-fairy entities)
(actions/do-dialogue entities :fairy-godfather "Young Tick, you must choose your destiny!") (actions/do-dialogue entities :fairy-godfather "Young Tick, you must choose your destiny!")
(actions/present-choices entities {:choices ["What if I don't like any of these choices?" (actions/present-choices entities {:choices ["What if I don't like any of these choices?"
{:run #(do (actions/respond entities % {:run #(do (actions/respond entities %
@@ -269,8 +281,8 @@
:ego "I saw a, um...")) :ego "I saw a, um..."))
:choices ["... a dragon!" :choices ["... a dragon!"
{:run #(distract entities % "dragon")} {:run #(distract entities % "dragon")}
"... a flying zebra!" "... a ghost!"
{:run #(distract entities % "flying zebra")} {:run #(distract entities % "ghost")}
"... a fairy godfather-eating plant!" "... a fairy godfather-eating plant!"
{:run #(distract entities % "fairy godfather-eating plant")}] } {:run #(distract entities % "fairy godfather-eating plant")}] }
@@ -293,7 +305,7 @@
(defn make [screen] (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]) (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])] fairy-godfather-talk-anim (utils/make-anim "dream/fairy-godfather.png" [63 77] 0.15 [5 6 7 8 7 6])]
(rooms/make :music :town-1 (rooms/make :music :dream
:interactions {:pit {:box [54 0 219 36] :interactions {:pit {:box [54 0 219 36]
:script (actions/get-script entities :script (actions/get-script entities
(actions/walk-to entities :ego [154 41]) (actions/walk-to entities :ego [154 41])
@@ -307,7 +319,7 @@
(actions/play-animation entities :ego :reach-stop :stop? true) (actions/play-animation entities :ego :reach-stop :stop? true)
(actions/do-dialogue entities (actions/do-dialogue entities
:ego "I can't bring myself to do it." :ego "I can't bring myself to do it."
:ego "That sounds horrible!" :ego "It seems like misery!"
:ego "Plus, how can I ever win the heart of my true love, Georgia McGorgeous?")) :ego "Plus, how can I ever win the heart of my true love, Georgia McGorgeous?"))
:broom (actions/get-script entities :broom (actions/get-script entities
(actions/walk-to entities :ego [154 41]) (actions/walk-to entities :ego [154 41])
@@ -318,7 +330,7 @@
(actions/play-animation entities :ego :reach-stop :stop? true) (actions/play-animation entities :ego :reach-stop :stop? true)
(actions/do-dialogue entities (actions/do-dialogue entities
:ego "I can't bring myself to do it." :ego "I can't bring myself to do it."
:ego "That sounds horrible!" :ego "It seems like misery!"
:ego "Plus, how can I ever win the heart of my true love, Georgia McGorgeous?"))}}} :ego "Plus, how can I ever win the heart of my true love, Georgia McGorgeous?"))}}}
:timers {:return [15.0 15.0 return-from-island]} :timers {:return [15.0 15.0 return-from-island]}
:layers [(assoc (texture "dream/clouds1.png") :x -10 :y 0 :baseline -1 :parallax 0.2 :scale-x 1.1 :scale-y 1.1) :layers [(assoc (texture "dream/clouds1.png") :x -10 :y 0 :baseline -1 :parallax 0.2 :scale-x 1.1 :scale-y 1.1)
@@ -350,8 +362,9 @@
(actions/remove-item entities :dream-sword) (actions/remove-item entities :dream-sword)
(actions/remove-item entities :broom) (actions/remove-item entities :broom)
(actions/remove-item entities :shovel) (actions/remove-item entities :shovel)
(actions/transition-background entities :inside-castle [79 145] :time 5.0) (actions/transition-background entities :inside-castle [92 150] :time 8.0)
(actions/resume-camera entities) (actions/resume-camera entities)
(actions/walk-straight-to entities :ego [79 145] :stop? false)
(actions/walk-to entities :ego [159 74]) (actions/walk-to entities :ego [159 74])
(actions/do-dialogue entities (actions/do-dialogue entities
:ego "Man! What a dream!" :ego "Man! What a dream!"

View File

@@ -60,15 +60,27 @@
(defn do-warden-dialogue [entities] (defn do-warden-dialogue [entities]
(actions/do-dialogue entities :ego "Hey, who are you? Why am I in this cell?" (actions/do-dialogue entities :ego "Hey, who are you? Why am I in this cell?"
:warden "You're under arrest for theft of public property." :warden "You're under arrest for theft of property."
:ego "Under arrest? But I'm the good guy!\nThe game is named after me!" :ego "Under arrest? Theft of property?"
:warden "Sorry chap. The law's the law.") :ego "I didn't steal the Sword of Blergh, I fulfilled the prophecy."
:warden "Slow down there, chap."
:warden "You're not under arrest for theft of the sword."
:warden "You're under arrest for stealing the Duke of Remington's ladder."
:ego "But I'm the good guy!\nThe game is named after me!"
:warden "Sorry chap. The law's the law."
)
(actions/present-choices entities (actions/present-choices entities
{:choices ["But I'm just a kid." {:choices ["But I'm just a kid."
{:run #(actions/respond entities % {:run #(actions/respond entities %
:warden "The Duke of Remington is a very stern chap." :warden "The Duke of Remington is a very stern chap."
:warden "He doesn't bend the rules, even for young thieves.") :warden "He doesn't bend the rules, even for young thieves.")
:choices actions/previous-choices} :choices actions/previous-choices}
"Took, son of Luke, son of Puke gave me that ladder!"
{:run #(actions/respond entities %
:warden "It wasn't his to give."
:warden "In fact, he's off to the gallows come dawn."
:ego "Oh, no.")
:choices actions/previous-choices}
"But I was going to teach Bloodclot a lesson!" "But I was going to teach Bloodclot a lesson!"
{:run #(actions/respond entities % {:run #(actions/respond entities %
:warden "Sure you were. If he even exists." :warden "Sure you were. If he even exists."

View File

@@ -48,7 +48,7 @@
(defn make [screen] (defn make [screen]
(rooms/make :music {:day :town-2 :night :night} (rooms/make :music {:day :secret-hideout :night :secret-hideout}
:interactions :interactions
{:left-dir {:box [91 60 125 140] {:left-dir {:box [91 60 125 140]
:script (actions/get-script :script (actions/get-script

View File

@@ -346,7 +346,7 @@
(if (= :night (get-in @entities [:state :time])) (if (= :night (get-in @entities [:state :time]))
(actions/talk entities :ego "It's locked.") (actions/talk entities :ego "It's locked.")
(do (actions/transition-background entities :inside-house [237 0] :between (fn [s e] (do (actions/transition-background entities :inside-house [237 0] :between (fn [s e]
(if (= 1 (rand-int 3)) (if (= 1 (rand-int 10))
(assoc-in e [:room :entities :experiment] (get-in e [:room :experiment])) (assoc-in e [:room :entities :experiment] (get-in e [:room :experiment]))
e))) e)))
(when (get-in @entities [:room :entities :experiment]) (when (get-in @entities [:room :entities :experiment])
@@ -419,7 +419,8 @@
(walk-to-sheep entities) (walk-to-sheep entities)
(actions/talk entities :ego "Come on girl, get the grass!") (actions/talk entities :ego "Come on girl, get the grass!")
(actions/play-animation entities :ego :reach) (actions/play-animation entities :ego :reach)
(actions/talk entities :ego "I think she's not interested.")) (actions/talk entities :ego "I think she's not interested.")
(leave-sheep entities))
:carrot (actions/get-script entities :carrot (actions/get-script entities
(walk-to-sheep entities) (walk-to-sheep entities)
(actions/talk entities :ego "Come on girl, get the carrot!") (actions/talk entities :ego "Come on girl, get the carrot!")

View File

@@ -182,7 +182,8 @@
bloodclot-explode (utils/make-anim "space/bloodclot-explode.png" [106 165] 0.075 [0 0 0 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 5 5 5 4 4 4 4 5 5 5 5 5 4 4 4 4 5 5 4 4 4 4 5 5 5 4 5 5 5 5 5 5 5 5 6 5 5 5 5 6 6 5 5 5 5 5 5 5 6 6 6 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 7 6 7 7 5 6 6 6 6 6 7 7 7 7 6 6 6 6 6 6 6 6 6 6 7 7 7 7 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 10 11 12 13 14 15 16 17 18 19]) bloodclot-explode (utils/make-anim "space/bloodclot-explode.png" [106 165] 0.075 [0 0 0 0 0 0 0 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 5 5 5 4 4 4 4 5 5 5 5 5 4 4 4 4 5 5 4 4 4 4 5 5 5 4 5 5 5 5 5 5 5 5 6 5 5 5 5 6 6 5 5 5 5 5 5 5 6 6 6 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 7 6 7 7 5 6 6 6 6 6 7 7 7 7 6 6 6 6 6 6 6 6 6 6 7 7 7 7 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 10 11 12 13 14 15 16 17 18 19])
bullet (utils/make-anim "space/bullet.png" [24 24] 0.0075 [0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 3 3 3 4 4 5 5 6 5 4 7]) bullet (utils/make-anim "space/bullet.png" [24 24] 0.0075 [0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 3 3 3 4 4 5 5 6 5 4 7])
effect (particle-effect "space/appear") effect (particle-effect "space/appear")
blowup-effect (particle-effect "space/blowup")] blowup-effect (particle-effect "space/blowup")
grow-explode (particle-effect "space/grow-explode")]
(rooms/make :music :fight (rooms/make :music :fight
:interactions :interactions
{} {}
@@ -192,6 +193,9 @@
:entities {:appear (assoc effect :entities {:appear (assoc effect
:x 240 :y 50 :x 240 :y 50
:baseline 200) :baseline 200)
:grow-explode (assoc grow-explode
:x 240 :y 130
:baseline 200)
:blowup (assoc blowup-effect :blowup (assoc blowup-effect
:x 225 :y 175 :x 225 :y 175
:baseline 240) :baseline 240)

View File

@@ -364,7 +364,11 @@ void main()
axe (utils/make-anim "ego/axe.png" [60 70] 0.10 (flatten [1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 (range 7)])) axe (utils/make-anim "ego/axe.png" [60 70] 0.10 (flatten [1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 (range 7)]))
axe-wood (utils/make-anim "ego/axe-wood.png" [60 70] 0.10 (flatten [1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 (range 11)])) axe-wood (utils/make-anim "ego/axe-wood.png" [60 70] 0.10 (flatten [1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 (range 11)]))
suspended (utils/make-anim "ego/suspended.png" [18 36] 0.10 [0]) suspended (utils/make-anim "ego/suspended.png" [18 36] 0.10 [0])
suspended-talk (utils/make-anim "ego/suspended.png" [18 36] 0.20 [0 1]) suspended-talk (utils/make-anim "ego/suspended.png" [18 36] 0.20 (range 7))
crawl (utils/make-anim "ego/crawl.png" [39 25] 0.2 (range 4))
crawl-stand (utils/make-anim "ego/crawl.png" [39 25] 0.2 [0])
crawl-hide (utils/make-anim "ego/crawl.png" [39 25] 0.1 (flatten [(repeat 10 3) (range 4 7) (repeat 50 6) (reverse (range 4 7) ) (repeat 20 3)]))
standup (utils/make-anim "ego/standup.png" [45 55] 0.2 (range 5))
ego {:right {:walk walk-right ego {:right {:walk walk-right
:stand stand-anim :stand stand-anim
@@ -411,6 +415,10 @@ void main()
:axe-wood axe-wood :axe-wood axe-wood
:suspended suspended :suspended suspended
:suspended-talk suspended-talk :suspended-talk suspended-talk
:crawl crawl
:crawl-stand crawl-stand
:crawl-hide crawl-hide
:standup standup
} }
:left {:walk (utils/flip walk-right) :left {:walk (utils/flip walk-right)
:stand (utils/flip stand-anim) :stand (utils/flip stand-anim)
@@ -448,6 +456,10 @@ void main()
:axe-wood (utils/flip axe-wood) :axe-wood (utils/flip axe-wood)
:suspended (utils/flip suspended) :suspended (utils/flip suspended)
:suspended-talk (utils/flip suspended-talk) :suspended-talk (utils/flip suspended-talk)
:crawl (utils/flip crawl)
:crawl-stand (utils/flip crawl-stand)
:crawl-hide (utils/flip crawl-hide)
:standup (utils/flip standup)
} }
:baseline (- 240 (last start-pos)) :baseline (- 240 (last start-pos))
:facing :right :facing :right
@@ -534,6 +546,10 @@ void main()
:anim-merges {(get-in ego [:right :shock]) {:origin-x 15} :anim-merges {(get-in ego [:right :shock]) {:origin-x 15}
(get-in ego [:left :swing-shovel]) {:origin-x 26} (get-in ego [:left :swing-shovel]) {:origin-x 26}
(get-in ego [:right :swing-shovel]) {:origin-x 26} (get-in ego [:right :swing-shovel]) {:origin-x 26}
(get-in ego [:right :standup]) {:origin-x 32}
(get-in ego [:right :crawl]) {:origin-x 32}
(get-in ego [:right :crawl-hide]) {:origin-x 32}
(get-in ego [:right :crawl-stand]) {:origin-x 32}
(get-in ego [:right :axe]) {:origin-x 17} (get-in ego [:right :axe]) {:origin-x 17}
(get-in ego [:right :axe-wood]) {:origin-x 17} (get-in ego [:right :axe-wood]) {:origin-x 17}
(get-in ego [:left :love]) {:origin-x 36} (get-in ego [:left :love]) {:origin-x 36}
@@ -684,6 +700,7 @@ void main()
(when shader (when shader
(.setUniformf shader "multiply_amount" (float (or multiply-amount 1.0))) (.setUniformf shader "multiply_amount" (float (or multiply-amount 1.0)))
(.setUniformf shader "hue_amount" (float (or hue-amount 1.0)))) (.setUniformf shader "hue_amount" (float (or hue-amount 1.0))))
(.setColor batch (color (:r e 1.0) (:g e 1.0) (:b e 1.0) (:opacity e 1.0))) (.setColor batch (color (:r e 1.0) (:g e 1.0) (:b e 1.0) (:opacity e 1.0)))
@@ -765,7 +782,9 @@ void main()
:inside-fangald (utils/make-music "inside-fangald.ogg") :inside-fangald (utils/make-music "inside-fangald.ogg")
:fight (utils/make-music "megaboss.mp3") :fight (utils/make-music "megaboss.mp3")
:pull-sword (utils/make-music "pull-sword.ogg") :pull-sword (utils/make-music "pull-sword.ogg")
:night (utils/make-music "night.ogg")} :night (utils/make-music "night.ogg")
:dream (utils/make-music "dream/music.ogg")
:secret-hideout (utils/make-music "secret-hideout.ogg")}
:state (get-state) :state (get-state)
:time-profiles {:object nil :time-profiles {:object nil
:default utils/default-night-merge :default utils/default-night-merge

View File

@@ -15,6 +15,7 @@
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter] (:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
[com.badlogic.gdx.graphics.g2d TextureRegion] [com.badlogic.gdx.graphics.g2d TextureRegion]
[com.badlogic.gdx.utils.viewport FitViewport] [com.badlogic.gdx.utils.viewport FitViewport]
[com.badlogic.gdx.scenes.scene2d.ui Slider$SliderStyle]
[com.badlogic.gdx.scenes.scene2d.utils Align] [com.badlogic.gdx.scenes.scene2d.utils Align]
[com.badlogic.gdx Application Audio Files Game Gdx Graphics Input [com.badlogic.gdx Application Audio Files Game Gdx Graphics Input
InputMultiplexer InputProcessor Net Preferences Screen])) InputMultiplexer InputProcessor Net Preferences Screen]))
@@ -29,6 +30,12 @@
(label! e :set-style (style :label font (get-color e mouse-pos))) (label! e :set-style (style :label font (get-color e mouse-pos)))
e) e)
(defn style-slider [s mouse-pos]
(if (utils/intersects? s mouse-pos)
(slider! s :set-style (:hover s))
(slider! s :set-style (:default s)))
s)
(defn center [e] (defn center [e]
(assoc e :x (- (/ 1280 2) (/ (.getWidth (:object e)) 2)))) (assoc e :x (- (/ 1280 2) (/ (.getWidth (:object e)) 2))))
@@ -39,9 +46,9 @@
(utils/setup-viewport screen 1280 960) (utils/setup-viewport screen 1280 960)
(utils/load-settings!) (utils/load-settings!)
(let [font (utils/get-font "ego/font.fnt") (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 :height 32 :origin-x 0 :origin-y 0) start-playing (assoc (label "Begin quest" (style :label font (color 0.6 1.0 1.0 1.0))) :x 0 :y 300 :height 64 :origin-x 0 :origin-y 0)
start-playing (center start-playing) 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 65 :height 32 :origin-x 0 :origin-y 0) quit (assoc (label "End quest" (style :label font (color 0.6 1.0 1.0 1.0))) :x 0 :y 65 :height 32 :origin-x 0 :origin-y 0)
quit (center quit) quit (center quit)
music (utils/make-music "intro.ogg") music (utils/make-music "intro.ogg")
ui-skin (skin "ui/ui.json")] ui-skin (skin "ui/ui.json")]
@@ -55,17 +62,30 @@
:opacity 1.0 :opacity 1.0
:origin-x 0 :origin-x 0
:origin-y 0) :origin-y 0)
:music-volume-slider (assoc (slider {:min 0 :max 100 :step 1} ui-skin :set-value (:music-volume @utils/settings))
:x ( - (/ 1280 2) :music-label (-> (label "Music" (style :label font (color 1.0 1.0 1.0 1.0)))
150) (assoc :x 0 :y 240 :height 32 :origin-x 0 :origin-y 0)
:width 300 center)
:y 200) :music-volume-slider (-> (slider {:min 0 :max 100 :step 1} ui-skin :set-value (:music-volume @utils/settings))
(assoc :x (- (/ 1280 2) 150)
:width 300
:y 195
:hover (skin! ui-skin :get "default-horizontal-hover" Slider$SliderStyle)
:default (skin! ui-skin :get "default-horizontal" Slider$SliderStyle)))
:sound-label (->
(label "FX" (style :label font (color 1.0 1.0 1.0 1.0)))
(assoc :x 0 :y 150 :height 32 :origin-x 0 :origin-y 0)
center)
:sound-volume-slider (assoc (slider {:min 0 :max 100 :step 1 } ui-skin :set-value (:sound-volume @utils/settings)) :sound-volume-slider (assoc (slider {:min 0 :max 100 :step 1 } ui-skin :set-value (:sound-volume @utils/settings))
:width 300 :width 300
:x ( - (/ 1280 2) :x ( - (/ 1280 2)
150) 150)
:y 150) :y 105
:hover (skin! ui-skin :get "default-horizontal-hover" Slider$SliderStyle)
:default (skin! ui-skin :get "default-horizontal" Slider$SliderStyle))
:font font :font font
:music music :music music
:volume 1.0 :volume 1.0
@@ -81,7 +101,8 @@
(clear!) (clear!)
(let [entities (utils/apply-tweens screen entities (:tweens entities))] (let [entities (utils/apply-tweens screen entities (:tweens entities))]
(music! (:music entities) :set-volume (utils/current-music-volume (:volume entities))) (music! (:music entities) :set-volume (utils/current-music-volume (:volume entities)))
(render! screen [(:overlay entities) (:start-playing entities) (:quit entities) (:music-volume-slider entities) (:sound-volume-slider entities) (:fade entities) ]) ()
(render! screen [(:overlay entities) (:start-playing entities) (:quit entities) (:music-label entities) (:music-volume-slider entities) (:sound-label entities) (:sound-volume-slider entities) (:fade entities) ])
entities)) entities))
:show-screen (fn [entities] :show-screen (fn [entities]
@@ -91,6 +112,8 @@
(let [[x y] (utils/unproject screen)] (let [[x y] (utils/unproject screen)]
(style-label (:start-playing entities) (get-in entities [:font]) [x y]) (style-label (:start-playing entities) (get-in entities [:font]) [x y])
(style-label (:quit entities) (get-in entities [:font]) [x y]) (style-label (:quit entities) (get-in entities [:font]) [x y])
(style-slider (:music-volume-slider entities) [x y])
(style-slider (:sound-volume-slider entities) [x y])
entities)) entities))
:on-ui-changed :on-ui-changed
(fn [screen [entities]] (fn [screen [entities]]