fighting bloodclot coming along

This commit is contained in:
2015-02-15 01:20:52 -08:00
parent 63a4ba065a
commit 8d93158af0
29 changed files with 122 additions and 14 deletions

1
desktop/fight-blergh.edn Normal file
View File

@@ -0,0 +1 @@
{:active? true, :convinced-wizard? true, :time :day, :inventory [:ladder :glass-eye :recipe :grass :medal :kiss :trophy :flask-1-strength :sword], :wizard-left? false, :clues #{}, :current-riddle :wool, :last-room :space, :wants-toy true, :mints-eaten 0, :object nil, :obtained-items #{:kiss :medal :sword :flask-1 :grass :ladder :trophy}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
</array>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
</array>
</plist>

View File

@@ -161,7 +161,7 @@
(can-skip? [this screen entities] (can-skip? [this screen entities]
false)))) false))))
(defn play-animation [entities target-id anim & {:keys [stop?]}] (defn play-animation [entities target-id anim & {:keys [stop? continue?]}]
(run-action entities (run-action entities
(begin [this screen entities] (begin [this screen entities]
(update-in entities [:room :entities target-id] #(start-animation screen % anim) )) (update-in entities [:room :entities target-id] #(start-animation screen % anim) ))
@@ -174,9 +174,11 @@
(- (:total-time screen) (get-in entities [:room :entities target-id :anim-start])))) (- (:total-time screen) (get-in entities [:room :entities target-id :anim-start]))))
(terminate [this screen entities] (terminate [this screen entities]
(if (or (nil? stop?) stop?) (if continue?
(stop screen entities target-id) entities
(assoc-in entities [:room :entities target-id :anim] nil))) (if (or (nil? stop?) stop?)
(stop screen entities target-id)
(assoc-in entities [:room :entities target-id :anim] nil))))
(can-skip? [this screen entities] (can-skip? [this screen entities]
false))) false)))

View File

@@ -159,12 +159,11 @@
#_(actions/play-animation entities :ego :swing) #_(actions/play-animation entities :ego :swing)
(actions/do-dialogue entities :blergh "Ha ha ha! Is that the best you can do?" (actions/do-dialogue entities :blergh "Ha ha ha! Is that the best you can do?"
:blergh "Take this!") :blergh "Take this!")
(actions/play-animation entities :blergh :swing) (actions/play-animation entities :ego :shock :stop? false)
(actions/walk-straight-to entities :ego [35 45] :anim :squat :override-dir :right :speed 3.0) (actions/play-animation entities :ego :burnt :stop? false)
(actions/do-dialogue entities :ego "Ouch!" (actions/play-animation entities :ego :passed-out :continue? true)
:blergh "My turn.")
#_(common/go-to-jail entities) (common/go-to-jail entities)
#_(actions/do-dialogue entities :ego "Hey!" #_(actions/do-dialogue entities :ego "Hey!"
:ego "What's going on? I was just about to teach Blergh a lesson!")) :ego "What's going on? I was just about to teach Blergh a lesson!"))
:magic-slingshot (actions/get-script entities :magic-slingshot (actions/get-script entities
@@ -189,7 +188,7 @@
:x 222 :y 172 :baseline 240) :x 222 :y 172 :baseline 240)
:collision "space/collision.png" :collision "space/collision.png"
:scale-fn (constantly 1.5) :scale-fn (constantly 1.5)
:start-pos [140 55] :start-pos [35 45]
:apply-state (fn [e] :apply-state (fn [e]
(as-> e e (as-> e e
(if (get-in e [:state :broke-jewel?]) (if (get-in e [:state :broke-jewel?])

View File

@@ -184,6 +184,9 @@
crowbar (utils/make-anim "ego/crowbar.png" [36 36] 0.1 [0 0 0 1 1 2 2 2 2 2 3 2 3 2 3 2 3 2 3 3 3 1 1 0 0 0]) crowbar (utils/make-anim "ego/crowbar.png" [36 36] 0.1 [0 0 0 1 1 2 2 2 2 2 3 2 3 2 3 2 3 2 3 3 3 1 1 0 0 0])
shoot (utils/make-anim "ego/shoot.png" [24 36] 0.075 [0 0 0 1 1 2 2 2 2 2 2 2 2 3 4 5 4]) shoot (utils/make-anim "ego/shoot.png" [24 36] 0.075 [0 0 0 1 1 2 2 2 2 2 2 2 2 3 4 5 4])
pant (utils/make-anim "ego/pant.png" [31 36] 0.5 [0 1]) pant (utils/make-anim "ego/pant.png" [31 36] 0.5 [0 1])
shock (utils/make-anim "ego/shock.png" [40 48] 0.075 (flatten (repeat 2 [(repeat 5 [0 1 2]) (repeat 5 [3 4 5]) (repeat 5 [6 7 8])])))
burnt (utils/make-anim "ego/burnt.png" [40 46] 0.12 [1 2 3 2 1 2 3 2 1 0 2 0 4 5 6 7 8 9 10 11 10 9 10 11])
passed-out (utils/make-anim "ego/burnt.png" [40 46] 0.12 [9 10 11 10])
ego {:right {:walk walk-right ego {:right {:walk walk-right
:stand stand-anim :stand stand-anim
@@ -211,7 +214,10 @@
[:fire 2] fire-2-anim [:fire 2] fire-2-anim
[:fire 3] fire-3-anim [:fire 3] fire-3-anim
:spear spear :spear spear
:pant pant} :pant pant
:shock shock
:burnt burnt
:passed-out passed-out}
:left {:walk (utils/flip walk-right) :left {:walk (utils/flip walk-right)
:stand (utils/flip stand-anim) :stand (utils/flip stand-anim)
:talk (utils/flip talk-anim) :talk (utils/flip talk-anim)
@@ -293,7 +299,9 @@
ego (assoc ego :anim-sound-frames {(get-in ego [:left :walk]) {2 :step-sound ego (assoc ego :anim-sound-frames {(get-in ego [:left :walk]) {2 :step-sound
6 :step-sound} 6 :step-sound}
(get-in ego [:right :walk]) {2 :step-sound (get-in ego [:right :walk]) {2 :step-sound
6 :step-sound}})] 6 :step-sound}}
:anim-merges {(get-in ego [:right :shock]) {:origin-x 15}
:default {:origin-x 9}})]
(actions/start-animation screen (actions/start-animation screen
(merge (animation->texture screen (:stand (:right ego))) ego) (merge (animation->texture screen (:stand (:right ego))) ego)
:stand))) :stand)))
@@ -338,7 +346,9 @@
(merge entity (animation->texture (update-in screen [:total-time] #(- % (:anim-start entity))) (merge entity (animation->texture (update-in screen [:total-time] #(- % (:anim-start entity)))
(:anim entity)) (:anim entity))
{:current-frame-index (texture! (:anim entity) :get-key-frame-index (get-animation-point (:anim entity) (- (:total-time screen) (:anim-start entity)))) {:current-frame-index (texture! (:anim entity) :get-key-frame-index (get-animation-point (:anim entity) (- (:total-time screen) (:anim-start entity))))
:previous-frame-index (texture! (:anim entity) :get-key-frame-index (get-animation-point (:anim entity) (- (:total-time screen) (:anim-start entity) (or (:delta-time screen) 0))))})) :previous-frame-index (texture! (:anim entity) :get-key-frame-index (get-animation-point (:anim entity) (- (:total-time screen) (:anim-start entity) (or (:delta-time screen) 0))))}
(or (get-in entity [:anim-merges (:anim entity)])
(get-in entity [:anim-merges :default]))))
(defn get-layers [entities] (defn get-layers [entities]