good progress on fight experience.
BIN
desktop/asset-work/global/ego/tongue-idle_0.ase
Normal file
BIN
desktop/asset-work/global/ego/tongue-idle_0.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
desktop/asset-work/global/ego/tongue-idle_1.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
desktop/asset-work/global/ego/tongue-stance_0.ase
Normal file
BIN
desktop/asset-work/global/ego/tongue-stance_0.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
desktop/asset-work/global/ego/tongue-stance_1.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
desktop/asset-work/global/ego/tongue-stance_2.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
desktop/asset-work/global/ego/tongue-stance_3.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
desktop/asset-work/global/ego/tongue-stance_4.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
desktop/asset-work/global/ego/tongue-stance_5.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
desktop/asset-work/global/ego/tongue-stance_6.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
desktop/asset-work/tongue-fight/background.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
desktop/asset-work/tongue-fight/hair-0_0.png
Normal file
|
After Width: | Height: | Size: 118 B |
BIN
desktop/asset-work/tongue-fight/hair-0_1.png
Normal file
|
After Width: | Height: | Size: 127 B |
BIN
desktop/asset-work/tongue-fight/hair-0_2.png
Normal file
|
After Width: | Height: | Size: 119 B |
BIN
desktop/asset-work/tongue-fight/hair-0_3.png
Normal file
|
After Width: | Height: | Size: 112 B |
BIN
desktop/asset-work/tongue-fight/hair-0_4.png
Normal file
|
After Width: | Height: | Size: 125 B |
BIN
desktop/asset-work/tongue-fight/hair-1_0.png
Normal file
|
After Width: | Height: | Size: 273 B |
BIN
desktop/asset-work/tongue-fight/hair-1_1.png
Normal file
|
After Width: | Height: | Size: 280 B |
BIN
desktop/asset-work/tongue-fight/hair-1_2.png
Normal file
|
After Width: | Height: | Size: 280 B |
BIN
desktop/asset-work/tongue-fight/hair-2_0.png
Normal file
|
After Width: | Height: | Size: 897 B |
BIN
desktop/asset-work/tongue-fight/hair-2_1.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/hair-2_2.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/hair-3_0.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/hair-3_1.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/hair-3_2.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/hair-4_0.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/hair-4_1.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
desktop/asset-work/tongue-fight/hair-4_2.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
desktop/asset-work/tongue-fight/hair-5_0.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/hair-5_1.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
desktop/asset-work/tongue-fight/hair-5_2.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
desktop/asset-work/tongue-fight/hair-6_0.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/hair-6_1.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
desktop/asset-work/tongue-fight/hair-6_2.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
desktop/asset-work/tongue-fight/hair-7_0.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/hair-7_1.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
desktop/asset-work/tongue-fight/hair-7_2.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
desktop/asset-work/tongue-fight/hair-8_0.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/hair-8_1.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
desktop/asset-work/tongue-fight/hair-8_2.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
desktop/asset-work/tongue-fight/hair-9_0.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
desktop/asset-work/tongue-fight/hair-9_1.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/hair-9_2.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
desktop/asset-work/tongue-fight/heart_0.png
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
desktop/asset-work/tongue-fight/tongue-idle/tongue-idle_0.ase
Normal file
BIN
desktop/asset-work/tongue-fight/tongue-idle/tongue-idle_0.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
desktop/asset-work/tongue-fight/tongue-idle/tongue-idle_1.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
desktop/asset-work/tongue-fight/tongue-idle/tongue-idle_2.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
desktop/asset-work/tongue-fight/tongue-idle/tongue-idle_3.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
desktop/asset-work/tongue-fight/tongue-idle/tongue-idle_4.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
desktop/asset-work/tongue-fight/tongue-idle_0.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
@@ -2,7 +2,7 @@
|
|||||||
(def packs (into ["do"]
|
(def packs (into ["do"]
|
||||||
(mapcat (fn [directory]
|
(mapcat (fn [directory]
|
||||||
["run" "-m" "com.badlogic.gdx.tools.texturepacker.TexturePacker" (str "asset-work/" directory) "resources/packed/" (str directory ",")])
|
["run" "-m" "com.badlogic.gdx.tools.texturepacker.TexturePacker" (str "asset-work/" directory) "resources/packed/" (str directory ",")])
|
||||||
["title" ]
|
["tongue-fight" ]
|
||||||
#_["behindhouse" "dream" "georgia" "inside-cafeteria" "inside-jail" "outsidehouse" "safe-song" "title"
|
#_["behindhouse" "dream" "georgia" "inside-cafeteria" "inside-jail" "outsidehouse" "safe-song" "title"
|
||||||
"castle-gate" "ego" "held" "inside-castle" "inside-stash" "outside-castle" "screenshots" "wizard"
|
"castle-gate" "ego" "held" "inside-castle" "inside-stash" "outside-castle" "screenshots" "wizard"
|
||||||
"cat-tree" "ending-castle" "inside-antique" "inside-house" "outside-jail" "space" ])))
|
"cat-tree" "ending-castle" "inside-antique" "inside-house" "outside-jail" "space" ])))
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 184 KiB |
BIN
desktop/resources/packed/global2.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
292
desktop/resources/packed/tongue-fight.atlas
Normal file
@@ -0,0 +1,292 @@
|
|||||||
|
|
||||||
|
tongue-fight.png
|
||||||
|
size: 512,256
|
||||||
|
format: RGBA8888
|
||||||
|
filter: Nearest,Nearest
|
||||||
|
repeat: none
|
||||||
|
background
|
||||||
|
rotate: false
|
||||||
|
xy: 2, 14
|
||||||
|
size: 320, 240
|
||||||
|
orig: 320, 240
|
||||||
|
offset: 0, 0
|
||||||
|
index: -1
|
||||||
|
hair-0
|
||||||
|
rotate: false
|
||||||
|
xy: 442, 160
|
||||||
|
size: 7, 8
|
||||||
|
orig: 7, 8
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
hair-0
|
||||||
|
rotate: false
|
||||||
|
xy: 467, 178
|
||||||
|
size: 7, 8
|
||||||
|
orig: 7, 8
|
||||||
|
offset: 0, 0
|
||||||
|
index: 1
|
||||||
|
hair-0
|
||||||
|
rotate: false
|
||||||
|
xy: 372, 24
|
||||||
|
size: 7, 8
|
||||||
|
orig: 7, 8
|
||||||
|
offset: 0, 0
|
||||||
|
index: 2
|
||||||
|
hair-0
|
||||||
|
rotate: false
|
||||||
|
xy: 428, 128
|
||||||
|
size: 7, 8
|
||||||
|
orig: 7, 8
|
||||||
|
offset: 0, 0
|
||||||
|
index: 3
|
||||||
|
hair-0
|
||||||
|
rotate: false
|
||||||
|
xy: 477, 196
|
||||||
|
size: 7, 8
|
||||||
|
orig: 7, 8
|
||||||
|
offset: 0, 0
|
||||||
|
index: 4
|
||||||
|
hair-1
|
||||||
|
rotate: false
|
||||||
|
xy: 442, 170
|
||||||
|
size: 23, 16
|
||||||
|
orig: 23, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
hair-1
|
||||||
|
rotate: false
|
||||||
|
xy: 372, 34
|
||||||
|
size: 23, 16
|
||||||
|
orig: 23, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: 1
|
||||||
|
hair-1
|
||||||
|
rotate: false
|
||||||
|
xy: 397, 34
|
||||||
|
size: 23, 16
|
||||||
|
orig: 23, 16
|
||||||
|
offset: 0, 0
|
||||||
|
index: 2
|
||||||
|
hair-2
|
||||||
|
rotate: false
|
||||||
|
xy: 324, 52
|
||||||
|
size: 47, 66
|
||||||
|
orig: 47, 66
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
hair-2
|
||||||
|
rotate: false
|
||||||
|
xy: 428, 188
|
||||||
|
size: 47, 66
|
||||||
|
orig: 47, 66
|
||||||
|
offset: 0, 0
|
||||||
|
index: 1
|
||||||
|
hair-2
|
||||||
|
rotate: false
|
||||||
|
xy: 373, 52
|
||||||
|
size: 47, 66
|
||||||
|
orig: 47, 66
|
||||||
|
offset: 0, 0
|
||||||
|
index: 2
|
||||||
|
hair-3
|
||||||
|
rotate: false
|
||||||
|
xy: 491, 226
|
||||||
|
size: 7, 8
|
||||||
|
orig: 7, 8
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
hair-3
|
||||||
|
rotate: false
|
||||||
|
xy: 32, 4
|
||||||
|
size: 7, 8
|
||||||
|
orig: 7, 8
|
||||||
|
offset: 0, 0
|
||||||
|
index: 1
|
||||||
|
hair-3
|
||||||
|
rotate: false
|
||||||
|
xy: 442, 150
|
||||||
|
size: 7, 8
|
||||||
|
orig: 7, 8
|
||||||
|
offset: 0, 0
|
||||||
|
index: 2
|
||||||
|
hair-4
|
||||||
|
rotate: false
|
||||||
|
xy: 428, 158
|
||||||
|
size: 12, 28
|
||||||
|
orig: 12, 28
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
hair-4
|
||||||
|
rotate: false
|
||||||
|
xy: 477, 226
|
||||||
|
size: 12, 28
|
||||||
|
orig: 12, 28
|
||||||
|
offset: 0, 0
|
||||||
|
index: 1
|
||||||
|
hair-4
|
||||||
|
rotate: false
|
||||||
|
xy: 358, 22
|
||||||
|
size: 12, 28
|
||||||
|
orig: 12, 28
|
||||||
|
offset: 0, 0
|
||||||
|
index: 2
|
||||||
|
hair-5
|
||||||
|
rotate: false
|
||||||
|
xy: 2, 2
|
||||||
|
size: 8, 10
|
||||||
|
orig: 8, 10
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
hair-5
|
||||||
|
rotate: false
|
||||||
|
xy: 12, 2
|
||||||
|
size: 8, 10
|
||||||
|
orig: 8, 10
|
||||||
|
offset: 0, 0
|
||||||
|
index: 1
|
||||||
|
hair-5
|
||||||
|
rotate: false
|
||||||
|
xy: 22, 2
|
||||||
|
size: 8, 10
|
||||||
|
orig: 8, 10
|
||||||
|
offset: 0, 0
|
||||||
|
index: 2
|
||||||
|
hair-6
|
||||||
|
rotate: false
|
||||||
|
xy: 422, 112
|
||||||
|
size: 4, 6
|
||||||
|
orig: 4, 6
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
hair-6
|
||||||
|
rotate: false
|
||||||
|
xy: 428, 120
|
||||||
|
size: 4, 6
|
||||||
|
orig: 4, 6
|
||||||
|
offset: 0, 0
|
||||||
|
index: 1
|
||||||
|
hair-6
|
||||||
|
rotate: false
|
||||||
|
xy: 477, 188
|
||||||
|
size: 4, 6
|
||||||
|
orig: 4, 6
|
||||||
|
offset: 0, 0
|
||||||
|
index: 2
|
||||||
|
hair-7
|
||||||
|
rotate: false
|
||||||
|
xy: 505, 247
|
||||||
|
size: 5, 7
|
||||||
|
orig: 5, 7
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
hair-7
|
||||||
|
rotate: false
|
||||||
|
xy: 505, 238
|
||||||
|
size: 5, 7
|
||||||
|
orig: 5, 7
|
||||||
|
offset: 0, 0
|
||||||
|
index: 1
|
||||||
|
hair-7
|
||||||
|
rotate: false
|
||||||
|
xy: 505, 229
|
||||||
|
size: 5, 7
|
||||||
|
orig: 5, 7
|
||||||
|
offset: 0, 0
|
||||||
|
index: 2
|
||||||
|
hair-8
|
||||||
|
rotate: false
|
||||||
|
xy: 451, 162
|
||||||
|
size: 6, 6
|
||||||
|
orig: 6, 6
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
hair-8
|
||||||
|
rotate: false
|
||||||
|
xy: 467, 170
|
||||||
|
size: 6, 6
|
||||||
|
orig: 6, 6
|
||||||
|
offset: 0, 0
|
||||||
|
index: 1
|
||||||
|
hair-8
|
||||||
|
rotate: false
|
||||||
|
xy: 381, 26
|
||||||
|
size: 6, 6
|
||||||
|
orig: 6, 6
|
||||||
|
offset: 0, 0
|
||||||
|
index: 2
|
||||||
|
hair-9
|
||||||
|
rotate: false
|
||||||
|
xy: 428, 138
|
||||||
|
size: 12, 18
|
||||||
|
orig: 12, 18
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
hair-9
|
||||||
|
rotate: false
|
||||||
|
xy: 477, 206
|
||||||
|
size: 12, 18
|
||||||
|
orig: 12, 18
|
||||||
|
offset: 0, 0
|
||||||
|
index: 1
|
||||||
|
hair-9
|
||||||
|
rotate: false
|
||||||
|
xy: 491, 236
|
||||||
|
size: 12, 18
|
||||||
|
orig: 12, 18
|
||||||
|
offset: 0, 0
|
||||||
|
index: 2
|
||||||
|
heart
|
||||||
|
rotate: false
|
||||||
|
xy: 324, 18
|
||||||
|
size: 32, 32
|
||||||
|
orig: 32, 32
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
tongue-idle
|
||||||
|
rotate: false
|
||||||
|
xy: 324, 120
|
||||||
|
size: 102, 134
|
||||||
|
orig: 102, 134
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
|
||||||
|
tongue-fight2.png
|
||||||
|
size: 1024,256
|
||||||
|
format: RGBA8888
|
||||||
|
filter: Nearest,Nearest
|
||||||
|
repeat: none
|
||||||
|
tongue-idle/tongue-idle
|
||||||
|
rotate: false
|
||||||
|
xy: 2, 2
|
||||||
|
size: 135, 145
|
||||||
|
orig: 135, 145
|
||||||
|
offset: 0, 0
|
||||||
|
index: 0
|
||||||
|
tongue-idle/tongue-idle
|
||||||
|
rotate: false
|
||||||
|
xy: 139, 2
|
||||||
|
size: 135, 145
|
||||||
|
orig: 135, 145
|
||||||
|
offset: 0, 0
|
||||||
|
index: 1
|
||||||
|
tongue-idle/tongue-idle
|
||||||
|
rotate: false
|
||||||
|
xy: 276, 2
|
||||||
|
size: 135, 145
|
||||||
|
orig: 135, 145
|
||||||
|
offset: 0, 0
|
||||||
|
index: 2
|
||||||
|
tongue-idle/tongue-idle
|
||||||
|
rotate: false
|
||||||
|
xy: 413, 2
|
||||||
|
size: 135, 145
|
||||||
|
orig: 135, 145
|
||||||
|
offset: 0, 0
|
||||||
|
index: 3
|
||||||
|
tongue-idle/tongue-idle
|
||||||
|
rotate: false
|
||||||
|
xy: 550, 2
|
||||||
|
size: 135, 145
|
||||||
|
orig: 135, 145
|
||||||
|
offset: 0, 0
|
||||||
|
index: 4
|
||||||
BIN
desktop/resources/packed/tongue-fight.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
desktop/resources/packed/tongue-fight2.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
257
desktop/src-common/advent/screens/rooms/tongue_fight.clj
Normal file
@@ -0,0 +1,257 @@
|
|||||||
|
(ns advent.screens.rooms.tongue-fight
|
||||||
|
(:require [advent.screens.rooms :as rooms]
|
||||||
|
[advent.screens.rooms.common :as common]
|
||||||
|
[advent.screens.rooms.held :as held]
|
||||||
|
[advent.saves :as saves]
|
||||||
|
[advent.actions :as actions]
|
||||||
|
[advent.screens.items :as items]
|
||||||
|
[advent.utils :as utils]
|
||||||
|
[advent.tween :as tween]
|
||||||
|
[clojure.zip :as zip]
|
||||||
|
[clojure.set :as set]
|
||||||
|
[clojure.string :as str]
|
||||||
|
[play-clj.core :refer :all]
|
||||||
|
[play-clj.ui :refer :all]
|
||||||
|
[play-clj.utils :refer :all]
|
||||||
|
[play-clj.math :refer :all]
|
||||||
|
[play-clj.g2d :refer :all]))
|
||||||
|
(println "loading " *ns*)
|
||||||
|
|
||||||
|
(defn cause-damage [entities is-player-wound?]
|
||||||
|
(if is-player-wound?
|
||||||
|
(update-in entities [:room :ego-hearts] dec)
|
||||||
|
(update-in entities [:room :tongue-hearts] dec)))
|
||||||
|
|
||||||
|
(defn show-heart [entities screen is-player-wound?]
|
||||||
|
|
||||||
|
(let [[x y] (if is-player-wound?
|
||||||
|
[256 163]
|
||||||
|
[146 185])]
|
||||||
|
(-> entities
|
||||||
|
(update-in [:room :entities :heart] #(assoc % :opacity 1 :x x :y y))
|
||||||
|
(assoc-in [:tweens :heart-y] (tween/tween :heart-y screen [:room :entities :heart :y] y (+ y 10) 0.5 :ease tween/ease-out-cubic))
|
||||||
|
(assoc-in [:tweens :heart-opacity] (tween/tween :heart-opacity screen [:room :entities :heart :opacity] 1.0 0.0 0.5 :ease tween/ease-in-cubic))
|
||||||
|
(cause-damage is-player-wound?))))
|
||||||
|
|
||||||
|
(defn stop-swing-if-necessary [screen {{{{:keys [anim anim-start] {:keys [tongue-swing]} :left } :ego} :entities} :room :as entities}]
|
||||||
|
(if (and (= tongue-swing anim)
|
||||||
|
(animation! anim
|
||||||
|
:is-animation-finished
|
||||||
|
(- (:total-time screen) anim-start)))
|
||||||
|
(update-in entities [:room :entities :ego] #(actions/start-animation screen % :tongue-idle))
|
||||||
|
entities))
|
||||||
|
|
||||||
|
(defn trigger-tongue [screen {{{
|
||||||
|
{:keys [state started anim anim-start]} :tongue
|
||||||
|
{ego-anim :anim {ego-windup :tongue-windup} :left } :ego
|
||||||
|
} :entities
|
||||||
|
:keys [ego-hearts tongue-hearts]} :room
|
||||||
|
:as entities}]
|
||||||
|
(let [time-in-state (- (:total-time screen) (or started (:total-time screen)))
|
||||||
|
is-player-wound? (= ego-anim ego-windup)
|
||||||
|
entities (stop-swing-if-necessary screen entities)]
|
||||||
|
(cond
|
||||||
|
(and (not (get-in entities [:fg-actions :script-running?]))
|
||||||
|
(get-in entities [:state :active?])
|
||||||
|
(= 0 ego-hearts))
|
||||||
|
(do
|
||||||
|
((actions/get-script entities
|
||||||
|
(actions/transition-background entities :held [113 120])
|
||||||
|
(Thread/sleep 10000))
|
||||||
|
entities)
|
||||||
|
entities)
|
||||||
|
|
||||||
|
(and (not (get-in entities [:fg-actions :script-running?]))
|
||||||
|
(get-in entities [:state :active?])
|
||||||
|
(= 0 tongue-hearts))
|
||||||
|
(do
|
||||||
|
((actions/get-script entities
|
||||||
|
(actions/transition-background entities :cat-tree [113 120])
|
||||||
|
(Thread/sleep 10000))
|
||||||
|
entities)
|
||||||
|
entities)
|
||||||
|
|
||||||
|
(and
|
||||||
|
(= state :attack)
|
||||||
|
(animation! anim
|
||||||
|
:is-animation-finished
|
||||||
|
(- (:total-time screen) anim-start)))
|
||||||
|
(-> entities
|
||||||
|
(update-in [:room :entities :tongue] #(actions/start-animation screen % :idle))
|
||||||
|
(update-in [:room :entities :tongue] assoc :state :idle :started (:total-time screen)))
|
||||||
|
|
||||||
|
(and
|
||||||
|
(= state :windup)
|
||||||
|
(animation! anim
|
||||||
|
:is-animation-finished
|
||||||
|
(- (:total-time screen) anim-start)))
|
||||||
|
(-> entities
|
||||||
|
(update-in [:room :entities :tongue] #(actions/start-animation screen % :attack))
|
||||||
|
(update-in [:room :entities :tongue] assoc :state :attack :started (:total-time screen))
|
||||||
|
(update-in [:room :entities :ego] #(if is-player-wound?
|
||||||
|
(actions/start-animation screen % :tongue-swing)
|
||||||
|
%))
|
||||||
|
(show-heart screen is-player-wound?))
|
||||||
|
|
||||||
|
;; reset timer if you wind up while the tongue is idle
|
||||||
|
(and (= state :idle)
|
||||||
|
is-player-wound?)
|
||||||
|
(assoc-in entities [:room :entities :tongue :started] (:total-time screen))
|
||||||
|
|
||||||
|
(and (= state :idle)
|
||||||
|
(= 1 (rand-int (* 60 3)))
|
||||||
|
(> time-in-state 3.0)
|
||||||
|
(not is-player-wound?))
|
||||||
|
(-> entities
|
||||||
|
(update-in [:room :entities :tongue] #(actions/start-animation screen % :windup))
|
||||||
|
(update-in [:room :entities :tongue] assoc :state :windup :started (:total-time screen)))
|
||||||
|
|
||||||
|
(not started)
|
||||||
|
(assoc-in entities [:room :entities :tongue :started] (:total-time screen))
|
||||||
|
:else
|
||||||
|
|
||||||
|
entities
|
||||||
|
)))
|
||||||
|
|
||||||
|
(defn make [screen atlas global-atlas]
|
||||||
|
(let [hair-0 (utils/make-anim-seq atlas "hair-0" [7 8] 0.12 (range 4))
|
||||||
|
hair-1 (utils/make-anim-seq atlas "hair-1" [23 16] 0.13 [0 1 2 1])
|
||||||
|
hair-2 (utils/make-anim-seq atlas "hair-2" [47 66] 0.15 [0 1 2 1])
|
||||||
|
hair-3 (utils/make-anim-seq atlas "hair-3" [7 8] 0.12 [0 1 2 1])
|
||||||
|
hair-4 (utils/make-anim-seq atlas "hair-4" [12 28] 0.12 [0 1 2 1])
|
||||||
|
hair-5 (utils/make-anim-seq atlas "hair-5" [8 10] 0.12 [0 1 2 1])
|
||||||
|
hair-6 (utils/make-anim-seq atlas "hair-6" [4 6] 0.16 [0 1 2 1])
|
||||||
|
hair-7 (utils/make-anim-seq atlas "hair-7" [5 7] 0.16 [0 1 2 1])
|
||||||
|
hair-8 (utils/make-anim-seq atlas "hair-8" [6 6] 0.16 [0 1 2 1])
|
||||||
|
hair-9 (utils/make-anim-seq atlas "hair-9" [12 18] 0.16 [0 1 2 1])
|
||||||
|
heart (utils/make-anim-seq atlas "heart" [32 32] 0.16 [0])
|
||||||
|
tongue-idle (utils/make-anim-seq atlas "tongue-idle/tongue-idle" [135 145] 0.16 (range 5))
|
||||||
|
tongue-windup (utils/make-anim-seq atlas "tongue-idle/tongue-idle" [135 145] 0.16 [0 0 0 0 0])
|
||||||
|
tongue-attack (utils/make-anim-seq atlas "tongue-idle/tongue-idle" [135 145] 0.16 [1 1 1 1])]
|
||||||
|
|
||||||
|
|
||||||
|
(rooms/make :name "Tongue Fight"
|
||||||
|
|
||||||
|
:interactions {}
|
||||||
|
:layers [(assoc (utils/atlas->texture atlas "background") :x 0 :y 0 :baseline 0 :scale-x 1 :scale-y 1)]
|
||||||
|
:update-fn trigger-tongue
|
||||||
|
:ego-hearts 5
|
||||||
|
:tongue-hearts 5
|
||||||
|
|
||||||
|
:entities {:hair-0 (assoc (animation->texture screen hair-0)
|
||||||
|
:x 35
|
||||||
|
:y 46
|
||||||
|
:width 6
|
||||||
|
:height 7
|
||||||
|
:baseline 1
|
||||||
|
:anim hair-0
|
||||||
|
:anim-start 0)
|
||||||
|
:hair-1 (assoc (animation->texture screen hair-1)
|
||||||
|
:x 113
|
||||||
|
:y 176
|
||||||
|
:width 23
|
||||||
|
:height 16
|
||||||
|
:baseline 1
|
||||||
|
:anim hair-1
|
||||||
|
:anim-start 0)
|
||||||
|
:hair-2 (assoc (animation->texture screen hair-2)
|
||||||
|
:x 243
|
||||||
|
:y 104
|
||||||
|
:width 47
|
||||||
|
:height 66
|
||||||
|
:baseline 1
|
||||||
|
:anim hair-2
|
||||||
|
:anim-start 0)
|
||||||
|
:hair-3 (assoc (animation->texture screen hair-3)
|
||||||
|
:x 121
|
||||||
|
:y 222
|
||||||
|
:width 7
|
||||||
|
:height 8
|
||||||
|
:baseline 1
|
||||||
|
:anim hair-3
|
||||||
|
:anim-start 0)
|
||||||
|
:hair-4 (assoc (animation->texture screen hair-4)
|
||||||
|
:x 71
|
||||||
|
:y 6
|
||||||
|
:width 12
|
||||||
|
:height 28
|
||||||
|
:baseline 1
|
||||||
|
:anim hair-4
|
||||||
|
:anim-start 0)
|
||||||
|
:hair-5 (assoc (animation->texture screen hair-5)
|
||||||
|
:x 100
|
||||||
|
:y 12
|
||||||
|
:width 8
|
||||||
|
:height 10
|
||||||
|
:baseline 1
|
||||||
|
:anim hair-5
|
||||||
|
:anim-start 0)
|
||||||
|
:hair-6 (assoc (animation->texture screen hair-6)
|
||||||
|
:x 113
|
||||||
|
:y 38
|
||||||
|
:width 4
|
||||||
|
:height 6
|
||||||
|
:baseline 1
|
||||||
|
:anim hair-6
|
||||||
|
:anim-start 0)
|
||||||
|
:hair-7 (assoc (animation->texture screen hair-7)
|
||||||
|
:x 125
|
||||||
|
:y 21
|
||||||
|
:width 5
|
||||||
|
:height 7
|
||||||
|
:baseline 1
|
||||||
|
:anim hair-7
|
||||||
|
:anim-start 0)
|
||||||
|
:hair-8 (assoc (animation->texture screen hair-8)
|
||||||
|
:x 145
|
||||||
|
:y 6
|
||||||
|
:width 6
|
||||||
|
:height 6
|
||||||
|
:baseline 1
|
||||||
|
:anim hair-8
|
||||||
|
:anim-start 0)
|
||||||
|
:hair-9 (assoc (animation->texture screen hair-9)
|
||||||
|
:x 23
|
||||||
|
:y 29
|
||||||
|
:width 12
|
||||||
|
:height 18
|
||||||
|
:baseline 1
|
||||||
|
:anim hair-9
|
||||||
|
:anim-start 0)
|
||||||
|
:heart (assoc (animation->texture screen heart)
|
||||||
|
:x 23
|
||||||
|
:y 29
|
||||||
|
:width 32
|
||||||
|
:height 32
|
||||||
|
:baseline 320
|
||||||
|
:opacity 0
|
||||||
|
:anim heart
|
||||||
|
:anim-start 0)
|
||||||
|
:tongue (assoc (animation->texture screen tongue-idle)
|
||||||
|
:x 186
|
||||||
|
:y 65
|
||||||
|
:origin-x 23
|
||||||
|
:origin-y 10
|
||||||
|
:width 135
|
||||||
|
:height 145
|
||||||
|
:baseline 2
|
||||||
|
:anim tongue-idle
|
||||||
|
:windup tongue-windup
|
||||||
|
:idle tongue-idle
|
||||||
|
:attack tongue-attack
|
||||||
|
:anim-start 0
|
||||||
|
:state :idle
|
||||||
|
:script (actions/get-script
|
||||||
|
entities
|
||||||
|
(actions/play-animation entities :ego :tongue-windup)))}
|
||||||
|
|
||||||
|
:collision "space/collision.png"
|
||||||
|
:scale-fn (constantly 1.0)
|
||||||
|
:start-pos [141 110]
|
||||||
|
:apply-state (fn [screen e]
|
||||||
|
(-> e
|
||||||
|
(update-in [:room :entities :ego] #(actions/start-animation screen % :tongue-idle))
|
||||||
|
(assoc-in [:room :entities :ego :stand-override] :tongue-idle)
|
||||||
|
(assoc-in [:room :entities :ego :x] 141)
|
||||||
|
(assoc-in [:room :entities :ego :y] 110))))))
|
||||||
|
|
||||||
@@ -36,6 +36,7 @@
|
|||||||
[advent.screens.rooms.inside-antique :as rooms.inside-antique]
|
[advent.screens.rooms.inside-antique :as rooms.inside-antique]
|
||||||
[advent.screens.rooms.behind-house :as rooms.behind-house]
|
[advent.screens.rooms.behind-house :as rooms.behind-house]
|
||||||
[advent.screens.rooms.outside-castle :as rooms.outside-castle]
|
[advent.screens.rooms.outside-castle :as rooms.outside-castle]
|
||||||
|
[advent.screens.rooms.tongue-fight :as rooms.tongue-fight]
|
||||||
[advent.screens.rooms.space :as rooms.space]
|
[advent.screens.rooms.space :as rooms.space]
|
||||||
[advent.screens.rooms.held :as rooms.held]
|
[advent.screens.rooms.held :as rooms.held]
|
||||||
[advent.screens.rooms.cat-tree :as rooms.cat-tree]
|
[advent.screens.rooms.cat-tree :as rooms.cat-tree]
|
||||||
@@ -518,6 +519,9 @@
|
|||||||
love (utils/make-anim-seq global-atlas "ego/love" [50 70] 0.1 (flatten [0 0 1 1 2 2 3 3 4 4 5 5 6 6 (repeat 10 7) (repeat 5 8) (repeat 5 7) (repeat 5 8) (repeat 5 7) (repeat 10 [23 24 25 24]) (repeat 30 9) 10 11 12 13 14 15 16 17 18 19 20 21 21 21 22 22 22 21 21 21 21 21 21 21 21 22 22 22 22 22 21 21 21 21 22 22 22 22 22 22 21 21 21 21 21 6 6 5 5 4 4 3 3 2 2 1 1 0]))
|
love (utils/make-anim-seq global-atlas "ego/love" [50 70] 0.1 (flatten [0 0 1 1 2 2 3 3 4 4 5 5 6 6 (repeat 10 7) (repeat 5 8) (repeat 5 7) (repeat 5 8) (repeat 5 7) (repeat 10 [23 24 25 24]) (repeat 30 9) 10 11 12 13 14 15 16 17 18 19 20 21 21 21 22 22 22 21 21 21 21 21 21 21 21 22 22 22 22 22 21 21 21 21 22 22 22 22 22 22 21 21 21 21 21 6 6 5 5 4 4 3 3 2 2 1 1 0]))
|
||||||
whistle (utils/make-anim-seq global-atlas "ego/whistle" [18 36] 0.2 (flatten [0 1 1 (repeat 200 [2 3])]))
|
whistle (utils/make-anim-seq global-atlas "ego/whistle" [18 36] 0.2 (flatten [0 1 1 (repeat 200 [2 3])]))
|
||||||
axe (utils/make-anim global-atlas "ego/axe" [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 global-atlas "ego/axe" [60 70] 0.10 (flatten [1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 (range 7)]))
|
||||||
|
tongue-windup (utils/make-anim-seq global-atlas "ego/tongue-stance" [119 134] 0.05 [0 1 2 2 2 2 2 2 2 2])
|
||||||
|
tongue-swing (utils/make-anim-seq global-atlas "ego/tongue-stance" [119 134] 0.12 [ 3 4 5 6 ])
|
||||||
|
tongue-idle (utils/make-anim-seq global-atlas "ego/tongue-idle" [119 134] 0.7 [0 1])
|
||||||
axe-wood (utils/make-anim global-atlas "ego/axe-wood" [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 global-atlas "ego/axe-wood" [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 global-atlas "ego/suspended" [20 36] 0.10 [0])
|
suspended (utils/make-anim global-atlas "ego/suspended" [20 36] 0.10 [0])
|
||||||
suspended-talk (utils/make-anim global-atlas "ego/suspended" [20 36] 0.20 (range 7))
|
suspended-talk (utils/make-anim global-atlas "ego/suspended" [20 36] 0.20 (range 7))
|
||||||
@@ -556,6 +560,9 @@
|
|||||||
:reach-down reach-down
|
:reach-down reach-down
|
||||||
:reach-start reach-start
|
:reach-start reach-start
|
||||||
:jump jump
|
:jump jump
|
||||||
|
:tongue-swing tongue-swing
|
||||||
|
:tongue-windup tongue-windup
|
||||||
|
:tongue-idle tongue-idle
|
||||||
:jump-straight jump-straight
|
:jump-straight jump-straight
|
||||||
:jumping-straight jumping-straight
|
:jumping-straight jumping-straight
|
||||||
:reach-stop reach-stop
|
:reach-stop reach-stop
|
||||||
@@ -615,6 +622,9 @@
|
|||||||
:reach-down (utils/flip reach-down)
|
:reach-down (utils/flip reach-down)
|
||||||
:reach-start (utils/flip reach-start)
|
:reach-start (utils/flip reach-start)
|
||||||
:jump-straight (utils/flip jump-straight)
|
:jump-straight (utils/flip jump-straight)
|
||||||
|
:tongue-swing tongue-swing
|
||||||
|
:tongue-windup tongue-windup
|
||||||
|
:tongue-idle tongue-idle
|
||||||
:jumping-straight (utils/flip jumping-straight)
|
:jumping-straight (utils/flip jumping-straight)
|
||||||
:reach-stop (utils/flip reach-stop)
|
:reach-stop (utils/flip reach-stop)
|
||||||
:shoot (utils/flip shoot)
|
:shoot (utils/flip shoot)
|
||||||
@@ -739,6 +749,10 @@
|
|||||||
(get-in ego [:left :frustrated-talk]) {:origin-x 7}
|
(get-in ego [:left :frustrated-talk]) {:origin-x 7}
|
||||||
(get-in ego [:left :jump-straight]) {:origin-x 9}
|
(get-in ego [:left :jump-straight]) {:origin-x 9}
|
||||||
(get-in ego [:right :jump-straight]) {:origin-x 9}
|
(get-in ego [:right :jump-straight]) {:origin-x 9}
|
||||||
|
(get-in ego [:left :tongue-swing]) {:origin-x 41 :origin-y 15}
|
||||||
|
(get-in ego [:left :tongue-windup]) {:origin-x 41 :origin-y 15}
|
||||||
|
(get-in ego [:left :tongue-idle]) {:origin-x 41 :origin-y 15}
|
||||||
|
|
||||||
(get-in ego [:left :poke]) {:origin-x 10}
|
(get-in ego [:left :poke]) {:origin-x 10}
|
||||||
(get-in ego [:right :poke]) {:origin-x 10}
|
(get-in ego [:right :poke]) {:origin-x 10}
|
||||||
(get-in ego [:left :jumping-straight]) {:origin-x 9}
|
(get-in ego [:left :jumping-straight]) {:origin-x 9}
|
||||||
@@ -1225,6 +1239,7 @@
|
|||||||
:cat-tree (wrap rooms.cat-tree/make "packed/cat-tree.atlas")
|
:cat-tree (wrap rooms.cat-tree/make "packed/cat-tree.atlas")
|
||||||
:inside-castle (wrap rooms.inside-castle/make "packed/inside-castle.atlas")
|
:inside-castle (wrap rooms.inside-castle/make "packed/inside-castle.atlas")
|
||||||
:space (wrap rooms.space/make "packed/space.atlas")
|
:space (wrap rooms.space/make "packed/space.atlas")
|
||||||
|
:tongue-fight (wrap rooms.tongue-fight/make "packed/tongue-fight.atlas")
|
||||||
:held (wrap rooms.held/make "packed/held.atlas")
|
:held (wrap rooms.held/make "packed/held.atlas")
|
||||||
:inside-cafeteria (wrap rooms.inside-cafeteria/make "packed/inside-cafeteria.atlas")
|
:inside-cafeteria (wrap rooms.inside-cafeteria/make "packed/inside-cafeteria.atlas")
|
||||||
:inside-antique (wrap rooms.inside-antique/make "packed/inside-antique.atlas")
|
:inside-antique (wrap rooms.inside-antique/make "packed/inside-antique.atlas")
|
||||||
@@ -1243,6 +1258,7 @@
|
|||||||
:cat-tree {:day :town-2 :night :night :sunrise :night}
|
:cat-tree {:day :town-2 :night :night :sunrise :night}
|
||||||
:inside-castle {:day :town-1 :night :night :sunrise :night}
|
:inside-castle {:day :town-1 :night :night :sunrise :night}
|
||||||
:space :fight
|
:space :fight
|
||||||
|
:tongue-fight :fight
|
||||||
:held :fight
|
:held :fight
|
||||||
:inside-cafeteria {:day :town-1 :night :night :sunrise :night}
|
:inside-cafeteria {:day :town-1 :night :night :sunrise :night}
|
||||||
:inside-antique :inside-antique
|
:inside-antique :inside-antique
|
||||||
|
|||||||