working on fight.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
[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)
|
||||
@@ -84,6 +85,7 @@
|
||||
tongue-finished?)
|
||||
(-> entities
|
||||
(update-in [:room :entities :tongue] #(actions/start-animation screen % :idle))
|
||||
(update-in [:room :entities :ego] #(actions/start-animation screen % :tongue-idle))
|
||||
(update-in [:room :entities :tongue] assoc :state :idle :started (:total-time screen))
|
||||
(update-in [:room :entities :heart] #(actions/start-animation screen % :idle)))
|
||||
|
||||
@@ -94,11 +96,13 @@
|
||||
ego-finished?))
|
||||
|
||||
(-> 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 :tongue] #(if is-player-wound?
|
||||
(actions/start-animation screen % :attack-hit)
|
||||
(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)
|
||||
%))
|
||||
(actions/start-animation screen % :tongue-hit)))
|
||||
(show-heart screen is-player-wound?))
|
||||
|
||||
(and (= state :idle)
|
||||
@@ -140,8 +144,9 @@
|
||||
heart (utils/make-anim-seq atlas "heart" [24 24] 0.08 [3])
|
||||
beat (utils/make-anim-seq atlas "heart" [24 24] 0.08 [0 1 0 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3])
|
||||
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-windup" [135 145] 0.16 [0 1 0 1 0 1 0 ])
|
||||
tongue-attack (utils/make-anim-seq atlas "tongue-attack" [135 145] 0.08 [0 1 2 2 2 2 2 2 2 2 2 2])]
|
||||
tongue-windup (utils/make-anim-seq atlas "tongue-windup" [135 145] 0.16 [0 1 2 3 2 1 2 3 2 1 0 ])
|
||||
tongue-attack (utils/make-anim-seq atlas "tongue-attack" [135 145] 0.08 [0 1 2 2 2 2 2 2 2 2 2 2])
|
||||
tongue-attack-hit (utils/make-anim-seq atlas "tongue-attack-hit" [135 145] 0.1 (range 7))]
|
||||
|
||||
|
||||
(rooms/make :name "Tongue Fight"
|
||||
@@ -244,21 +249,22 @@
|
||||
:beat beat
|
||||
:anim-start 0)
|
||||
:tongue (assoc (animation->texture screen tongue-idle)
|
||||
:x 186
|
||||
:y 65
|
||||
:x 211
|
||||
:y 40
|
||||
:origin-x 23
|
||||
:origin-y 10
|
||||
:width 135
|
||||
:height 145
|
||||
:baseline 2
|
||||
:baseline 4
|
||||
:anim tongue-idle
|
||||
:windup tongue-windup
|
||||
:idle tongue-idle
|
||||
:attack tongue-attack
|
||||
:attack-hit tongue-attack-hit
|
||||
:anim-merges {tongue-idle {:origin-x 23 :origin-y 10}
|
||||
tongue-windup {:origin-x 23 :origin-y 10}
|
||||
tongue-attack {:origin-x 119 :origin-y 10}
|
||||
}
|
||||
tongue-attack-hit {:origin-x 100 :origin-y 10}}
|
||||
:anim-start 0
|
||||
:state :idle
|
||||
:script (actions/get-script
|
||||
@@ -272,6 +278,7 @@
|
||||
(-> 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 :baseline] 3)
|
||||
(assoc-in [:room :entities :ego :x] 141)
|
||||
(assoc-in [:room :entities :ego :y] 110))))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user