some nice refinements.

This commit is contained in:
2015-04-22 19:57:17 -07:00
parent 9a6dafef41
commit 166595447c
6 changed files with 33 additions and 21 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -1 +1 @@
{:sound-volume 44.0, :music-volume 0.0}
{:sound-volume 44.0, :music-volume 41.0}

View File

@@ -104,9 +104,10 @@
target-zoom)
target-x (bound-to-camera x 320 target-zoom)
target-y (bound-to-camera y 240 target-zoom)]
(if (or (not= target-x (get-in entities [:cam :x]))
(not= target-y (get-in entities [:cam :y]))
(not= target-zoom (get-in entities [:cam :zoom])))
(if (and (or (not= target-x (get-in entities [:cam :x]))
(not= target-y (get-in entities [:cam :y]))
(not= target-zoom (get-in entities [:cam :zoom])))
(not (get-in entities [:cam :paused?])))
(-> entities
(assoc-in [:tweens :cam-zoom]
(tween/tween :cam-zoom screen
@@ -625,10 +626,14 @@
(assoc-in e [:room :entities :ego] ego)
(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))
(update-in e [:tweens] dissoc :cam-zoom :cam-x :cam-y)
(assoc-in e [:cam :x] 160)
(assoc-in e [:cam :y] 120)
(assoc-in e [:cam :zoom] 0.95)
(if-not (get-in entities [:cam :paused?])
(-> e
(update-in [:tweens] dissoc :cam-zoom :cam-x :cam-y)
(assoc-in [:cam :x] 160)
(assoc-in [:cam :y] 120)
(assoc-in [:cam :zoom] 0.95))
e)
(if music-changed?
(assoc-in e [:tweens :fade-in-music] (tween/tween :fade-in-music screen [:volume :value] 0.0 1.0 time))
e))

View File

@@ -28,6 +28,7 @@
(assoc-in [:room :layers 5 :opacity] opacity)
(assoc-in [:room :layers 6 :opacity] opacity)
(assoc-in [:room :entities :sword :opacity] tool-opacity)
(assoc-in [:room :entities :case :opacity] tool-opacity)
(assoc-in [:room :entities :broom :opacity] tool-opacity)
(assoc-in [:room :entities :shovel :opacity] tool-opacity)
(assoc-in [:room :entities :fairy-godfather :opacity] opacity)
@@ -83,14 +84,15 @@
:ego "If I become a knight, maybe Georgia McGorgeous will love me!")
(actions/in-love entities)
(actions/stop-walking entities :ego :face :right)
(actions/do-dialogue entities
: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."
:ego "Hey! Why can't I be a knight? It's my destiny!"
:ego "And plus, it's the only way to get Georgia McGorgeous to love me!"
:ego "And this plaque here says that maidens love knights."
:fairy-godfather "As long as you're under my watch, Tick, I forbid it!"
:fairy-godfather "And you're just not cut out for it!")
(when-not (get-in @entities [:room :entities :fairy-godfather :distracted?])
(actions/do-dialogue entities
: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."
:ego "Hey! Why can't I be a knight? It's my destiny!"
:ego "And plus, it's the only way to get Georgia McGorgeous to love me!"
:ego "And this plaque here says that maidens love knights."
:fairy-godfather "As long as you're under my watch, Tick, I forbid it!"
:fairy-godfather "And you're just not cut out for it!"))
(actions/update-state entities #(update-in % [:plaques-read] conj :sword)))
(defn read-broom-plaque [entities]
@@ -206,7 +208,7 @@
(particle-effect! (get-in entities [:room :entities :explode]) :reset)
(particle-effect! (get-in entities [:room :entities :explode]) :start)
(update-in entities [:room :entities] dissoc :sword))
(update-in entities [:room :entities] dissoc :case))
entities))
(done? [this screen entities]
@@ -311,7 +313,7 @@
:entities {:magic (assoc (particle-effect "dream/magic") :x 160 :y 80 :baseline 240)
:clouds (assoc (particle-effect "dream/cloudy2") :x 160 :y 120 :baseline 241)
:sword (assoc (texture "dream/sword.png")
:case (assoc (texture "dream/case.png")
:x 144 :y 122 :baseline 139
:script (actions/get-script entities
(read-sword-plaque entities))
@@ -319,7 +321,9 @@
(if (get-in @entities [:room :entities :fairy-godfather :distracted?])
(do (actions/walk-to entities :ego [148 76] :face :right)
(swing entities)
(actions/play-animation entities :ego :reach)
(actions/play-animation entities :ego :reach-start :stop? false)
(actions/remove-entity entities :sword)
(actions/play-animation entities :ego :reach-stop)
(actions/give entities :dream-sword)
(actions/do-dialogue entities :ego "Yes! Now, before he gets back!")
(actions/pause-camera entities)
@@ -328,8 +332,8 @@
(actions/remove-item entities :dream-sword)
(actions/remove-item entities :broom)
(actions/remove-item entities :shovel)
(actions/resume-camera entities)
(actions/transition-background entities :inside-castle [79 145] :time 5.0)
(actions/resume-camera entities)
(actions/walk-to entities :ego [159 74])
(actions/do-dialogue entities
:ego "Man! What a dream!"
@@ -345,6 +349,9 @@
(do (actions/walk-to entities :ego [148 76] :face :right)
(actions/do-dialogue entities
:fairy-godfather "What are you doing?" :ego "Erm... Nothing."))))})
:sword (assoc (texture "dream/sword.png")
:x 144 :y 122 :baseline 139)
:explode (assoc (particle-effect "dream/explode") :x 150 :y 138 :baseline 240)
:broom (assoc (texture "dream/broom.png") :x 286 :y 122
:path (catmull-rom-spline (map #(apply vector-2* %) [[286 122] [286 128]]) true)

View File

@@ -686,7 +686,7 @@
all-entities (concat (vals entities) layers (vals (get-in entities [:room :entities])))]
(screen! talking-screen :on-update-camera :scene-viewport (:viewport screen) :scene-camera (:camera screen))
(when (not (get-in entities [:cam :paused?]))
(when true #_(not (get-in entities [:cam :paused?]))
(set! (. camera zoom) (:zoom (:cam entities)))
(set! (.. camera position x) (:x (:cam entities) 160.0))
(set! (.. camera position y) (:y (:cam entities) 120.0)))