From 166595447c0bf381241e0e7dc975246c51cf7d3a Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Wed, 22 Apr 2015 19:57:17 -0700 Subject: [PATCH] some nice refinements. --- desktop/resources/dream/case.png | Bin 0 -> 1427 bytes desktop/resources/dream/sword.png | Bin 1427 -> 18862 bytes desktop/settings.edn | 2 +- desktop/src-common/advent/actions.clj | 19 +++++++---- .../src-common/advent/screens/rooms/dream.clj | 31 +++++++++++------- desktop/src-common/advent/screens/scene.clj | 2 +- 6 files changed, 33 insertions(+), 21 deletions(-) create mode 100644 desktop/resources/dream/case.png diff --git a/desktop/resources/dream/case.png b/desktop/resources/dream/case.png new file mode 100644 index 0000000000000000000000000000000000000000..aee0d858c61e6b7dded7579862f8e9488cc08f6e GIT binary patch literal 1427 zcmaJ>eM}Q)96nbp!xUR*f}3RXJSQKM_U=jxw9;Ye6=_0A`ADo8D%bXard;p19=3oE zgiRsfbjvo)E3G_fI1Q{ zCkhGNQd2cTWC8#$$y#h=jru&LnIa{47$b3!G{**j%q$m;n{5OOnuv0%T?IY*asUFY z78SHdu1EB=hN!US)-ps(OBC0!+V4x3>J zT!OGR74#%1quu~&D24##61munNKr6dAwlKx^mJ(oC`C{ijG!=@Dn=DbnM{cw;PMA? z-WW@nvJlHz_Ql;)PzB4l4+a7q!NUjP44l3YPM*h1o; zc>hz_QCve4a3SHKsu?raxUy|wSF}>Y5I9RQ#S~Q;siL8RVkt)jMS~j6Qq{mDJ#Mzz z!^Y$#mR_&a*&QryHxoKc1#vnOtJR{E$#XQaY;HkNEsAPo3JgIs8fiA7m8GVsrHTj_ zqs-MLVP_*;%L+FQS(O_e2$JSJV+3P8NLX?hiUgMuS6Ww(1zS~bnQK`!7P)p+F3bf3 zhuizFc1KLy426#?!^>S(#-FfrGtY3t{V2QD4**ZC(P8Rh*9}uJ6w2aVZrE^k-W@m} zN*)V7@Fl(_`(wtBA`P6zY+uB~_8Li#^FErgBE#VjaHqdsqVloE0_+D`WC*rV6CghT=oan1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v-NCTc~I;;52tLl zL*U~rIqx>@E!?<}r~XF7T*pVH^MtBD{)$x0Zu)#mdi$J)84n-cZPzIBy&Z4y_)1L2 z6M2CLQv^~IetqY6T~l(Hx9zz6e*vCcgNl!j*>$#j7wpmUtTW?bcDQ#yEY;`8v-tV| ziG~C7>-T@mK9**!@gN7n485$nk z+mK^@Vyljent}QRMg{$u9iJbaKmS6rQzw1@ugqV(>l<1A{&{uVyy8ouE<^ddI|mP} zNbH;Gc;}6S>hZXg=vIq}j_sA-yQiPKal}z9iDky@JrClNK3l|m{x7Zm{aunlxtg1> nhpwk8=RqmvG^LFU3I`b2*1l5wzLWnC0}yz+`njxgN@xNA0I{6! diff --git a/desktop/settings.edn b/desktop/settings.edn index e82fda4d..dfb2d27e 100644 --- a/desktop/settings.edn +++ b/desktop/settings.edn @@ -1 +1 @@ -{:sound-volume 44.0, :music-volume 0.0} \ No newline at end of file +{:sound-volume 44.0, :music-volume 41.0} \ No newline at end of file diff --git a/desktop/src-common/advent/actions.clj b/desktop/src-common/advent/actions.clj index 5dafcda1..4fb25776 100644 --- a/desktop/src-common/advent/actions.clj +++ b/desktop/src-common/advent/actions.clj @@ -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)) diff --git a/desktop/src-common/advent/screens/rooms/dream.clj b/desktop/src-common/advent/screens/rooms/dream.clj index e4cb7c30..c6ec98ff 100644 --- a/desktop/src-common/advent/screens/rooms/dream.clj +++ b/desktop/src-common/advent/screens/rooms/dream.clj @@ -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) diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index 57a03a9a..a38b72b3 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -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)))