diff --git a/desktop/resources/ego/fire.png b/desktop/resources/ego/fire.png new file mode 100644 index 00000000..b44f808f Binary files /dev/null and b/desktop/resources/ego/fire.png differ diff --git a/desktop/resources/ego/fire.pxa/0.pxi b/desktop/resources/ego/fire.pxa/0.pxi new file mode 100644 index 00000000..0422adf5 Binary files /dev/null and b/desktop/resources/ego/fire.pxa/0.pxi differ diff --git a/desktop/resources/ego/fire.pxa/1.pxi b/desktop/resources/ego/fire.pxa/1.pxi new file mode 100644 index 00000000..4417de42 Binary files /dev/null and b/desktop/resources/ego/fire.pxa/1.pxi differ diff --git a/desktop/resources/ego/fire.pxa/10.pxi b/desktop/resources/ego/fire.pxa/10.pxi new file mode 100644 index 00000000..56ae9ad3 Binary files /dev/null and b/desktop/resources/ego/fire.pxa/10.pxi differ diff --git a/desktop/resources/ego/fire.pxa/11.pxi b/desktop/resources/ego/fire.pxa/11.pxi new file mode 100644 index 00000000..858ce138 Binary files /dev/null and b/desktop/resources/ego/fire.pxa/11.pxi differ diff --git a/desktop/resources/ego/fire.pxa/2.pxi b/desktop/resources/ego/fire.pxa/2.pxi new file mode 100644 index 00000000..c59c6d47 Binary files /dev/null and b/desktop/resources/ego/fire.pxa/2.pxi differ diff --git a/desktop/resources/ego/fire.pxa/3.pxi b/desktop/resources/ego/fire.pxa/3.pxi new file mode 100644 index 00000000..9dc6da33 Binary files /dev/null and b/desktop/resources/ego/fire.pxa/3.pxi differ diff --git a/desktop/resources/ego/fire.pxa/4.pxi b/desktop/resources/ego/fire.pxa/4.pxi new file mode 100644 index 00000000..c7e0bd5a Binary files /dev/null and b/desktop/resources/ego/fire.pxa/4.pxi differ diff --git a/desktop/resources/ego/fire.pxa/5.pxi b/desktop/resources/ego/fire.pxa/5.pxi new file mode 100644 index 00000000..6156140c Binary files /dev/null and b/desktop/resources/ego/fire.pxa/5.pxi differ diff --git a/desktop/resources/ego/fire.pxa/6.pxi b/desktop/resources/ego/fire.pxa/6.pxi new file mode 100644 index 00000000..50d3fca6 Binary files /dev/null and b/desktop/resources/ego/fire.pxa/6.pxi differ diff --git a/desktop/resources/ego/fire.pxa/7.pxi b/desktop/resources/ego/fire.pxa/7.pxi new file mode 100644 index 00000000..a7d0e5bf Binary files /dev/null and b/desktop/resources/ego/fire.pxa/7.pxi differ diff --git a/desktop/resources/ego/fire.pxa/8.pxi b/desktop/resources/ego/fire.pxa/8.pxi new file mode 100644 index 00000000..ae751c58 Binary files /dev/null and b/desktop/resources/ego/fire.pxa/8.pxi differ diff --git a/desktop/resources/ego/fire.pxa/9.pxi b/desktop/resources/ego/fire.pxa/9.pxi new file mode 100644 index 00000000..65c8b6bf Binary files /dev/null and b/desktop/resources/ego/fire.pxa/9.pxi differ diff --git a/desktop/resources/ego/fire.pxa/CelData.plist b/desktop/resources/ego/fire.pxa/CelData.plist new file mode 100644 index 00000000..a0e63ed4 --- /dev/null +++ b/desktop/resources/ego/fire.pxa/CelData.plist @@ -0,0 +1,54 @@ + + + + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + duration + 1 + + + diff --git a/desktop/src-common/advent/actions.clj b/desktop/src-common/advent/actions.clj index 4fdd053e..257767c3 100644 --- a/desktop/src-common/advent/actions.clj +++ b/desktop/src-common/advent/actions.clj @@ -12,7 +12,7 @@ [advent.utils :as utils] [clojure.core.async :refer [put! ! >!! chan go thread take! alts!!]]) (:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter] - [com.badlogic.gdx.graphics.g2d TextureRegion] + [com.badlogic.gdx.graphics.g2d TextureRegion Animation] [com.badlogic.gdx Screen])) (defprotocol IAction @@ -42,10 +42,10 @@ entity))) (defn find-animation [entity anim] - (if (keyword? anim) + (if (instance? Animation anim) + anim (or (get-in entity [(:facing entity) anim]) - (anim entity)) - anim)) + (get entity anim)))) (defn start-animation [screen entity anim] (let [new-anim (find-animation entity anim)] diff --git a/desktop/src-common/advent/screens/rooms/inside_antique.clj b/desktop/src-common/advent/screens/rooms/inside_antique.clj index c4f50c18..72325219 100644 --- a/desktop/src-common/advent/screens/rooms/inside_antique.clj +++ b/desktop/src-common/advent/screens/rooms/inside_antique.clj @@ -135,6 +135,7 @@ (actions/talk entities :ego "I'll just try one of these mints.") (actions/play-animation entities :ego :reach) (actions/update-state entities (fn [s] (assoc s :mints-eaten (inc (s :mints-eaten))))) + (actions/play-animation entities :ego [:fire (get-in @entities [:state :mints-eaten])]) (actions/talk entities :ego "WOWZA! Those are hot.") (when (= 3 (get-in @entities [:state :mints-eaten])) (actions/talk entities :shopkeep "You brat! You ate the last mint.") diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index 5ccefa55..b701fe74 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -83,6 +83,7 @@ squat-sheet (texture! (texture "ego/squat.png") :split 18 36) reach-sheet (texture! (texture "ego/reach.png") :split 18 36) cat-toy-sheet (texture! (texture "ego/cat-toy.png") :split 41 50) + fire-sheet (texture! (texture "ego/fire.png") :split 18 36) walk-right (animation 0.075 (for [i (range 8)] (texture (aget player-sheet 0 i)))) stand-anim (animation 0.1 (for [i (flatten [(repeat 6 [(repeat 10 0) (repeat 3 1) (repeat 20 0)]) 3 4 5 5 5 6 5 6 5 6 5 4 3 ])] @@ -94,19 +95,31 @@ reach-anim (animation 0.1 (for [i [0 1 2 3 3 3 3 3 3 2 1 0]] (texture (aget reach-sheet 0 i)))) cat-toy-anim (animation 0.1 (for [i [0 0 1 1 2 2 3 4 3 2 3 4 3 2 3 4 3 2 3 4 3 2 2 1 1 0 0]] - (texture (aget cat-toy-sheet 0 i)))) + (texture (aget cat-toy-sheet 0 i)))) + fire-1-anim (animation 0.1 (for [i [0 1 2 2 2 3 2 3 2 2 2 1 0]] + (texture (aget fire-sheet 0 i)))) + fire-2-anim (animation 0.1 (for [i [0 1 2 2 2 2 3 2 3 2 2 2 4 5 6 7 2 2 2 2 2 2 2 2 1 0]] + (texture (aget fire-sheet 0 i)))) + fire-3-anim (animation 0.1 (for [i [0 1 2 2 2 2 3 2 3 2 2 2 4 5 6 7 2 2 2 8 9 10 11 2 2 2 2 2 2 2 2 0]] + (texture (aget fire-sheet 0 i)))) ego {:right {:walk walk-right :stand stand-anim :talk talk-anim :squat squat-anim :reach reach-anim - :cat-toy cat-toy-anim} + :cat-toy cat-toy-anim + [:fire 1] fire-1-anim + [:fire 2] fire-2-anim + [:fire 3] fire-3-anim} :left {:walk (utils/flip walk-right) :stand (utils/flip stand-anim) :talk (utils/flip talk-anim) :squat (utils/flip squat-anim) :reach (utils/flip reach-anim) - :cat-toy (utils/flip cat-toy-anim)} + :cat-toy (utils/flip cat-toy-anim) + [:fire 1] (utils/flip fire-1-anim) + [:fire 2] (utils/flip fire-2-anim) + [:fire 3] (utils/flip fire-3-anim)} :baseline 95 :facing :right :origin-x 9