From 1ac686039adfbc2b8cd6ef9b7a829fb66f267a00 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Thu, 11 Dec 2014 16:22:16 -0800 Subject: [PATCH] more starting of the fight. --- desktop/resources/inside-castle/hands-1.png | Bin 0 -> 3156 bytes desktop/src-common/advent/actions.clj | 25 ++++++++++++++++++ .../advent/screens/rooms/inside_cafeteria.clj | 17 +++++++++--- desktop/src-common/advent/screens/scene.clj | 4 ++- desktop/src-common/advent/utils.clj | 1 + 5 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 desktop/resources/inside-castle/hands-1.png diff --git a/desktop/resources/inside-castle/hands-1.png b/desktop/resources/inside-castle/hands-1.png new file mode 100644 index 0000000000000000000000000000000000000000..9078052919eb2ba1ef413ce595401a75892873d9 GIT binary patch literal 3156 zcmaJ@c{o)28y{=7N=#R3XiT!z>}D-t%*e=C#*7qojhSN%#*8tx7HTZTy-8@*C9;jJ z5G_iHn?1Urk`_`5sgxv@->BT*{o_9OJkL4b@Ap0L=Y2o#cAk^$?z(xg)=Di92(*~) zL}e=0!1-H4UGX%6)Z{7_Ln+N$>M074MsXwn$et(i2cUEzhYv6T4lgFG71#&@sU!(l z-coOd3z;htA~^Fph-jf$fd+v#+D3~x++aWo^#}NZP#f5ry6Z5gfM)~SiesP{Vh12l z;IvBucwIGRMZwkD%c(4QAf;Z4E| zATz0sKYb}qHn2dcR7^%9qoSe^QCNgX!bhS>BoY#ZL1Hj)g$6u4CRECahKGi)S+GC_ z!nqQGSSk>OLgy`V{6!H`8<>LWj}U}n2IFtTq2WIhrAQevnj=P{5h$ckI3L${?Qkg* z_&<$*)edLHhyf%M2p2_2xQcoNtXTjna`)ek<`ore$ZisWq9~jYs)!pQ1VW{Bstru> z2Eh~X$ku2a8jH5(!g>C9F5DVN;=wss5)qEW^g;PAcbPzwf!D+rwzTFw{hN8D6EB8UWdjuMd&`aRQR!N0KJ;ISwYmH@yB zI9veSn#&DfX9RDi zVyzfCHs*V8n_qWvR5Q(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((^jExFl>@`r0b1o4VSGUqeZpUVu zewZmSf5BHRk9RTY0_;($`3_wjhP}F&>HBu+`^14Yn`(xO`Y)EMs8c@d%A;BfqKf(-4x|5*J2)<^{^ZBtA@Z$V{1-U zW93d)pY%4oYiEycRD7h=@~t9^&z50dQ9O#$fJ31CR~V`$H!aR$&SCTPX|MrgOw0e< zOe^SBzkMznY*7ZlwJ&|nuyRte+*Mp{LA!y=VBiT}tA5f)4sv+umFJ zA~(V6xT#OcN=I|QK3<={3jTa08@0HMeU_u#(%kbQ7U{RmMP}7wbAF_v#5KdsP%#;w z518?e6+yRkEeTc0&)SN=kHWK;nO3!>%>HU)<3yTMJ+=y>?lo-dIcit39`Dk(GF8*N zkAl-r$QuOr(!1>^FOPO9>0qBH-%_?xWgZb<;UAuu%z&sj5Wo|VoZ9Soy#{arREMIz zCNDiD$rEzsPO&C*YZTw`amrS=$_RHY?VXE=G?k$3*YunIe01%7>O@!ExhIIpx`C@z zckV-)sP2%yKyZkjv&{PU(Mq)@Uhbh%L4Gj?+$5bbH_z|b0tP^%iAVfRaLaW|_osVj zD3KU#PV|#n?D1pdu$(D7mX(t{sPM>do;sjzlDFg9N{(0ei8tG_W;%ezvTUfrB+b= 0.1 @current-volume)) + + (terminate [this screen entities] + (music! (get-in entities [:musics old-music]) :stop) + (music! (get-in entities [:musics new-music]) :set-volume 1.0) + (music! (get-in entities [:musics new-music]) :play) + entities) + (can-skip? [this screen entities] + false))))) + (defn transition-background [entities new-background [x y]] (let [old-music (get-in @entities [:room :music]) new-music (get-in @entities [:rooms new-background :music]) diff --git a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj index 00609af7..25d076de 100644 --- a/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj +++ b/desktop/src-common/advent/screens/rooms/inside_cafeteria.clj @@ -9,6 +9,12 @@ [play-clj.utils :refer :all] [play-clj.g2d :refer :all])) +(defn make-fight-entity [] + (assoc (texture "inside-castle/fight-1.png") + :x 0 + :y 0 + :baseline 1000)) + (defn do-warrior-dialogue [entities] (actions/walk-to entities :ego [150 45] :face :left) (actions/talk entities :ego "Hey guys!") @@ -43,11 +49,13 @@ (actions/do-dialogue entities :ego "One sec.") (actions/play-animation entities :ego :grow) (actions/do-dialogue entities - :warriors "[Todo animation here]" :warriors "Congratulations young master. Thou art worthy in might." :warriors "Take my medal of strength.") (actions/give entities :medal)) (do + + (actions/transition-music entities :town-2 :fight) + (actions/add-entity entities :fight (get-in @entities [:room :fight])) (actions/do-dialogue entities :warriors "[Todo animation here]" :warriors "You lost, young master. Go hitherto, unto thy gym."))))} @@ -120,7 +128,8 @@ ladder-guard-sheet (texture! (texture "inside-cafeteria/ladder-guard.png") :split 37 87) ladder-guard-stand (animation 0.1 [(aget ladder-guard-sheet 0 0)]) ladder-guard-talk (animation 0.2 (for [i [0 0 0 0 1 0 0 1]] - (aget ladder-guard-sheet 0 i)))] + (aget ladder-guard-sheet 0 i))) + ] (rooms/make :music :town-1 :interactions {:right-dir {:box [300 0 320 120] @@ -132,7 +141,8 @@ :cursor :right} } :layers [(assoc (texture "inside-cafeteria/background.png") :x 0 :y 0 :baseline 0)] - :entities {:warriors (actions/start-animation screen (assoc (animation->texture screen warriors-stand) :x 5 :y 9 :baseline 180 + :entities { + :warriors (actions/start-animation screen (assoc (animation->texture screen warriors-stand) :x 5 :y 9 :baseline 180 :left {:stand (utils/flip warriors-stand) :talk (utils/flip warriors-stand)} @@ -152,6 +162,7 @@ :script (actions/get-script entities (actions/talk entities :ladder-guard "Do not toucheth, young sire.")))} :collision "inside-cafeteria/collision.png" + :fight (make-fight-entity) :scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.50) :apply-state (fn [entities] (as-> entities entities diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index e62895c2..0e31842f 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -1,4 +1,5 @@ (ns advent.screens.scene + (:refer-clojure :exclude [load]) (:require [play-clj.core :refer :all] [play-clj.ui :refer :all] [play-clj.utils :refer :all] @@ -245,7 +246,8 @@ :inside-antique (make-music "inside-antique.ogg") :town-1 (make-music "town-music-1.ogg") :town-2 (doto (make-music "town-music-2.ogg") play-sound) - :inside-fangald (make-music "inside-fangald.ogg")} + :inside-fangald (make-music "inside-fangald.ogg") + :fight (make-music "megaboss.mp3")} :state (get-state) :actions {:object nil :channel (chan) diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index e3db4a0d..726cdd61 100644 --- a/desktop/src-common/advent/utils.clj +++ b/desktop/src-common/advent/utils.clj @@ -1,4 +1,5 @@ (ns advent.utils + (:refer-clojure :exclude [load]) (:require [play-clj.core :refer :all] [play-clj.ui :refer :all] [play-clj.utils :refer :all]