refinement on closing.

This commit is contained in:
2014-12-23 15:44:36 -08:00
parent 3d41cb2cf9
commit 5a83a4a17d
32 changed files with 103 additions and 19 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,14 @@
<?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>
</array>
</plist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 15 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>

View File

@@ -241,7 +241,7 @@
(defn get-text-duration [text] (defn get-text-duration [text]
(* (count (s/split text #" ")) 0.5)) (* (count (s/split text #" ")) 0.5))
(defn talk [entities target-id text & {:keys [stop? animate?]}] (defn talk [entities target-id text & {:keys [stop? animate? anim]}]
(let [initial-time (atom nil) (let [initial-time (atom nil)
stop? (if (nil? stop?) true stop?) stop? (if (nil? stop?) true stop?)
animate? (if (nil? animate?) true animate?)] animate? (if (nil? animate?) true animate?)]
@@ -267,7 +267,7 @@
:target-id target-id :target-id target-id
:scale scale) :scale scale)
(if animate? (if animate?
(update-in entities [:room :entities target-id ] #(start-animation screen % :talk)) (update-in entities [:room :entities target-id ] #(start-animation screen % (or anim :talk)))
entities))) entities)))
(continue [this screen entities] entities) (continue [this screen entities] entities)

View File

@@ -109,7 +109,7 @@
:ego "I have to go show my friends!") :ego "I have to go show my friends!")
(actions/walk-to entities :ego [85 145] :face :right) (actions/walk-to entities :ego [85 145] :face :right)
(actions/transition-background entities :space [0 65]) (actions/transition-background entities :space [0 65])
(actions/walk-to entities :ego [150 65] :face :right) (actions/walk-straight-to entities :ego [140 55] :face :right)
(actions/add-entity entities :blergh (get-in @entities [:room :blergh])) (actions/add-entity entities :blergh (get-in @entities [:room :blergh]))
(actions/play-animation entities :blergh :appear :stop? false) (actions/play-animation entities :blergh :appear :stop? false)
(actions/transition-music entities :town-1 :fight) (actions/transition-music entities :town-1 :fight)

View File

@@ -13,7 +13,8 @@
(defn taunt [screen entities] (defn taunt [screen entities]
(when (and (not (get-in entities [:actions :script-running?])) (when (and (not (get-in entities [:actions :script-running?]))
(get-in entities [:state :active?])) (get-in entities [:state :active?])
(not (get-in entities [:state :blergh-dead?])))
((actions/get-script entities (actions/do-dialogue entities :blergh (rand-nth ["Come on, little man! Try and hit me!" ((actions/get-script entities (actions/do-dialogue entities :blergh (rand-nth ["Come on, little man! Try and hit me!"
"What's the matter? Cold feet?" "What's the matter? Cold feet?"
"Come here and fight me like man!" "Come here and fight me like man!"
@@ -28,7 +29,8 @@
blergh-talk-anim (animation 0.3 [blergh-talk blergh-stand]) blergh-talk-anim (animation 0.3 [blergh-talk blergh-stand])
blergh-stand-anim (animation 0.7 [blergh-flex blergh-stand]) blergh-stand-anim (animation 0.7 [blergh-flex blergh-stand])
blergh-swing (utils/make-anim "space/blergh-swing.png" [106 165] 0.1 [0 0 1 2 3 4 ]) blergh-swing (utils/make-anim "space/blergh-swing.png" [106 165] 0.1 [0 0 1 2 3 4 ])
blergh-appear (utils/make-anim "space/blergh-appear.png" [106 165] 0.05 (flatten [(range 10) 9 9 9 9 9 9 9 9 9 ]))] blergh-appear (utils/make-anim "space/blergh-appear.png" [106 165] 0.05 (flatten [(range 10) 9 9 9 9 9 9 9 9 9 ]))
blergh-grow (utils/make-anim "space/blergh-grow.png" [106 165] 0.10 [0 1 0 1 0 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 2 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 5 6 7 8 9 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11]) ]
(rooms/make :music :town-1 (rooms/make :music :town-1
:interactions :interactions
{} {}
@@ -39,6 +41,7 @@
:stand blergh-stand-anim :talk blergh-talk-anim :stand blergh-stand-anim :talk blergh-talk-anim
:swing blergh-swing :swing blergh-swing
:appear blergh-appear :appear blergh-appear
:grow blergh-grow
:talk-color (color 0.95 0.4 0.2 1.0) :talk-color (color 0.95 0.4 0.2 1.0)
:script (actions/get-script entities (actions/do-dialogue entities :blergh "Come on! Try and hit me!")) :script (actions/get-script entities (actions/do-dialogue entities :blergh "Come on! Try and hit me!"))
:scripts {:sword (actions/get-script entities :scripts {:sword (actions/get-script entities
@@ -53,4 +56,6 @@
:entities {} :entities {}
:collision "space/collision.png" :collision "space/collision.png"
:scale-fn (constantly 1.5) :scale-fn (constantly 1.5)
:start-pos [43 80]))) :start-pos [43 80]
:apply-state (fn [e]
(assoc-in e [:room :entities :blergh] (get-in e [:room :blergh]))))))

View File

@@ -94,20 +94,28 @@
:blergh "You're still no match for me." :blergh "You're still no match for me."
:blergh "Give it to me, or I'll make you regret it!") :blergh "Give it to me, or I'll make you regret it!")
(actions/present-choices entities {:choices ["Ok." (actions/present-choices entities {:choices ["Ok."
{:run #(do (actions/respond entities % {:run (fn [_]
:ego "Here you go." (actions/talk entities :ego "Ok." :anim :grow-talk :stop? false)
:blergh "Yes! Now I can drink this whole thing and can become powerful enough to rule the world!" (actions/talk entities :ego "Here you go." :anim :grow-talk)
:blergh "[GREEN]*gulp*[]" (actions/do-dialogue entities
:blergh "What's this? What's happening?") :blergh "Yes! Now I can drink this whole thing and can become powerful enough to rule the world!"
(actions/walk-straight-to entities :ego [100 45] :face :right) :blergh "[#AAFFAAFF]*gulp*[]"
(actions/do-dialogue entities :ego "TODO: explosion" :blergh "What's this? What's happening?")
:ego "You win!"))} (actions/talk entities :ego "Uh oh." :anim :grow-talk :stop? false)
(actions/walk-straight-to entities :ego [100 45] :face :right)
(actions/play-animation entities :blergh :grow :stop? false)
(actions/do-dialogue entities :ego "'Not more than that do drink,\nOr you'll push your body to the brink.'"
:ego "Brilliant! I win!")
(actions/walk-straight-to entities :ego [800 75] :face :right)
(actions/update-state entities (fn [s] (assoc s :blergh-dead? true))))}
"No way!" "No way!"
{:run #(do (actions/respond entities % :blergh "Then take this!") {:run (fn [_]
(actions/play-animation entities :blergh :swing) (actions/talk entities :ego "No way!" :anim :grow-talk)
(actions/walk-straight-to entities :ego [100 45] :anim :squat :override-dir :right :speed 3.0) (actions/talk entities :blergh "Then take this!")
(actions/do-dialogue entities :ego "Yeow!!" (actions/play-animation entities :blergh :swing)
:ego "Even with that potion, I'm not strong enough."))}]})) (actions/walk-straight-to entities :ego [100 45] :anim :squat :override-dir :right :speed 3.0)
(actions/do-dialogue entities :ego "Yeow!!"
:ego "Even with that potion, I'm not strong enough."))}]}))
(defn get-ego [screen start-pos start-scale] (defn get-ego [screen start-pos start-scale]
@@ -149,6 +157,7 @@
(texture (aget grow-sheet 0 i)))) (texture (aget grow-sheet 0 i))))
hold-up-to-window (utils/make-anim "ego/hold-up-to-window.png" [18 36] 0.1 [0 1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 1 0 0 0 0 0 0]) hold-up-to-window (utils/make-anim "ego/hold-up-to-window.png" [18 36] 0.1 [0 1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 1 0 0 0 0 0 0])
swing (utils/make-anim "ego/swing.png" [36 36] 0.05 (flatten [[0 0 0 1 2 3 3 3 3 ]])) swing (utils/make-anim "ego/swing.png" [36 36] 0.05 (flatten [[0 0 0 1 2 3 3 3 3 ]]))
grow-talk (utils/make-anim "ego/grow-talk.png" [18 36] 0.2 (range 2))
get-sick (animation 0.3 (map (partial get [(aget talk-sheet 0 0 ) (texture "ego/get-sick.png")]) [0 1 1 1 1 1 1 1 1 1 1 1]) ) get-sick (animation 0.3 (map (partial get [(aget talk-sheet 0 0 ) (texture "ego/get-sick.png")]) [0 1 1 1 1 1 1 1 1 1 1 1]) )
ego {:right {:walk walk-right ego {:right {:walk walk-right
:stand stand-anim :stand stand-anim
@@ -164,6 +173,7 @@
:get-sick get-sick :get-sick get-sick
:hold-up-to-window hold-up-to-window :hold-up-to-window hold-up-to-window
:swing swing :swing swing
:grow-talk grow-talk
[:fire 1] fire-1-anim [:fire 1] fire-1-anim
[:fire 2] fire-2-anim [:fire 2] fire-2-anim
[:fire 3] fire-3-anim} [:fire 3] fire-3-anim}
@@ -180,6 +190,7 @@
:cat-toy-last-half (utils/flip cat-toy-last-half) :cat-toy-last-half (utils/flip cat-toy-last-half)
:grow (utils/flip grow) :grow (utils/flip grow)
:hold-up-to-window (utils/flip hold-up-to-window) :hold-up-to-window (utils/flip hold-up-to-window)
:grow-talk (utils/flip grow-talk)
[:fire 1] (utils/flip fire-1-anim) [:fire 1] (utils/flip fire-1-anim)
[:fire 2] (utils/flip fire-2-anim) [:fire 2] (utils/flip fire-2-anim)
[:fire 3] (utils/flip fire-3-anim)} [:fire 3] (utils/flip fire-3-anim)}