battle works!

This commit is contained in:
2014-12-11 17:44:30 -08:00
parent 73f1997ead
commit 741ea740f0
2 changed files with 15 additions and 6 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

@@ -10,7 +10,7 @@
[play-clj.g2d :refer :all]))
(defn make-fight-entity []
(assoc (texture "inside-castle/fight-1.png")
(assoc (texture "inside-cafeteria/fight.png")
:x 0
:y 0
:baseline 1000))
@@ -54,11 +54,14 @@
(actions/give entities :medal))
(do
(actions/transition-music entities :town-2 :fight)
(actions/transition-music entities :town-1 :fight)
(actions/add-entity entities :fight (get-in @entities [:room :fight]))
(actions/add-entity entities :hands-fight (get-in @entities [:room :hands-fight]))
(actions/play-animation entities :hands-fight :lose)
(actions/transition-music entities :fight :town-1)
(actions/remove-entity entities :hands-fight)
(actions/remove-entity entities :fight)
(actions/do-dialogue entities
:warriors "[Todo animation here]"
:warriors "You lost, young master. Go hitherto, unto thy gym."))))}
"Something else."
{:choices actions/something-else}]
@@ -130,7 +133,13 @@
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)))
hands-fight-win (utils/make-anim "inside-cafeteria/hands-fight.png" [104 104] 0.075 [0 1 0 4 0 1 0 4 0 1 0 4 0 1 0 4 0 1 0 4 0 1 0 1 0 1 0 1])]
base-fight (repeat 3 [0 1 0 4 0 1 0 4 0 1 0 4 0 1 0 4 0 1 0 4 0 1 0 1 0 1 0 1 0 0 0 0 1 1 1 1 0 0 0 4 0 1 2 2 2 2 2 2 1 1 1 1 2 2 2 2 2 2 1 1 1 0 0 0 1 1 2 2 2 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 1 0 4 0 1 0 4 0 4 0 4 0 4 0 4 4 4 4 4 4 5 5 5 4 4 4 5 5 5 4 4 4 0 0 0 0 0 0 ])
hands-fight-win (utils/make-anim "inside-cafeteria/hands-fight.png" [104 104] 0.075 (flatten (concat
base-fight
[1 1 1 1 1 0 1 0 1 2 2 1 1 2 2 1 1 2 2 2 1 1 0 1 1 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3])))
hands-fight-lose (utils/make-anim "inside-cafeteria/hands-fight.png" [104 104] 0.075 (flatten (concat
base-fight
[4 4 4 4 4 4 0 0 0 0 4 4 4 0 0 0 4 4 4 0 0 1 1 0 0 4 4 4 5 5 5 5 4 4 4 5 5 5 5 4 4 4 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6])))]
(rooms/make :music :town-1
:interactions
{:right-dir {:box [300 0 320 120]
@@ -168,8 +177,8 @@
:x 122
:y 38
:baseline 1001
:anim hands-fight-win
:anim-start 0)
:win hands-fight-win
:lose hands-fight-lose)
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.50)
:apply-state (fn [entities]
(as-> entities entities