you can escape from jail properly.

This commit is contained in:
2014-12-27 17:02:23 -08:00
parent 193e530567
commit 329902dda8
16 changed files with 82 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

View File

@@ -114,4 +114,5 @@
:ball-n-chain {:name "Ball-n-chain" :value :ball-n-chain :cursor :ball-n-chain}
:key {:name "Jail key" :value :key :cursor :key}
:rope {:name "Rope" :value :rope :cursor :rope}
:crowbar {:name "Crowbar" :value :crowbar :cursor :crowbar}
})

View File

@@ -21,7 +21,7 @@
(actions/walk-to entities :ego [174 80] :face :right)
(actions/play-animation entities :ego :reach)
(actions/talk entities :ego "Yes, that's it!")
(actions/walk-straight-to entities :moveable-bars [60 77])
(actions/walk-straight-to entities :moveable-bars [65 77])
(actions/update-entities entities #(remove-lock %))
(actions/update-state entities #(assoc % :opened-bars? true)))
@@ -191,7 +191,34 @@
(actions/do-dialogue entities
:ego "What a peaceful night."
:ego "Oh my sweet Georgia McGorgeous. How will I ever save you now?"
:ego "I have to find a way out of here!"))}
:ego "I have to find a way out of here!"))
:scripts {:crowbar (actions/get-script entities
(if (get-in @entities [:state :bent-bars?])
(actions/do-dialogue entities :ego "They're bent as far as they can go.")
(do (actions/walk-to entities :ego [102 88] :face :right)
(actions/play-animation entities :ego :reach)
(actions/remove-entity entities :closed-window)
(actions/update-state entities #(assoc % :bent-bars? true))
(actions/do-dialogue entities :ego "Now we're getting somewhere."))))
:ball-n-chain (actions/get-script entities (if (get-in @entities [:state :bent-bars?])
(do (actions/walk-to entities :ego [102 88] :face :right)
(actions/play-animation entities :ego :reach)
(actions/update-state entities #(assoc % :dropped-ball? true))
(actions/do-dialogue entities :ego "Geronimo!!"
:ego "*crash*!")
(actions/remove-item entities :ball-n-chain))
(actions/do-dialogue entities :ego "I don't know what to do with that.")))
:sword (actions/get-script entities (actions/talk entities :ego "I wouldn't want to accidentally break the Sword of Blergh."))
:rope (actions/get-script entities (if (get-in @entities [:state :bent-bars?])
(do (actions/walk-to entities :ego [102 88] :face :right)
(actions/do-dialogue entities :ego "Here goes.")
(actions/play-animation entities :ego :reach)
(actions/do-dialogue entities
:ego "Uh oh. There's a guard right beneath the window."
:ego "I had better not, or else I'd get caught."))
(actions/do-dialogue entities :ego "Good thinking."
:ego "But I can't fit out that window."
:ego "And the bars are made of steel!")))}}
:hay {:box [130 86 177 102]
:script (actions/get-script entities
(search-hay entities))}
@@ -258,7 +285,19 @@
(actions/remove-entity entities :ball-n-chain)
(actions/give entities :ball-n-chain)))
:moveable-bars (assoc (texture "inside-jail/moveable-bars.png")
:x 132 :y 77 :baseline 163)}
:x 132 :y 77 :baseline 163)
:crowbar (assoc (texture "inside-jail/crowbar.png")
:x 304 :y 65 :baseline 175
:script (actions/get-script entities
(if (get-in @entities [:state :opened-bars?])
(do (actions/walk-to entities :ego [295 55] :face :right)
(actions/play-animation entities :ego :reach)
(actions/remove-entity entities :crowbar )
(actions/give entities :crowbar)
(actions/talk entities :ego "It's a crowbar."))
(actions/talk entities :ego "I can't reach it."))))
:closed-window (assoc (texture "inside-jail/window.png")
:x 99 :y 111 :baseline 128)}
:collision "inside-jail/collision-locked.png"
:collision-free (advent.pathfind/map-from-resource "inside-jail/collision-free.png")
:scale-fn (utils/scaler-fn-with-baseline 0 0.50 1.5)
@@ -268,11 +307,17 @@
(if (actions/has-obtained? entities :ball-n-chain)
(update-in entities [:room :entities] #(dissoc % :ball-n-chain))
entities)
(if (actions/has-obtained? entities :crowbar)
(update-in entities [:room :entities] #(dissoc % :crowbar))
entities)
(if (get-in entities [:state :warden-sleeping?])
(update-in entities [:room :entities :warden] #(actions/start-animation % :sleep))
entities)
(if (get-in entities [:state :opened-bars?])
(update-in (remove-lock entities)
[:room :entities :moveable-bars]
#(assoc % :x 60 :y 77))
#(assoc % :x 65 :y 77))
entities)
(if (get-in entities [:state :bent-bars?])
(update-in entities [:room :entities] #(dissoc % :closed-window))
entities))))))

View File

@@ -14,7 +14,8 @@
(let [fountain (utils/make-anim "outside-jail/fountain.png" [42 50] 0.2 (range 3))
guard-sheet (texture! (texture "inside-cafeteria/ladder-guard.png") :split 37 87)
guard-stand (animation 0.1 [(aget guard-sheet 0 0)])
guard-talk (animation 0.2 (for [i [0 0 0 0 1 0 0 1]] (aget guard-sheet 0 i)))]
guard-talk (animation 0.2 (for [i [0 0 0 0 1 0 0 1]] (aget guard-sheet 0 i)))
guard-sleep (utils/make-anim "outside-jail/guard-sleep.png" [43 67] 0.1 (range 4))]
(rooms/make :music :town-2
:interactions {:down-dir {:box [30 0 227 20]
:script (actions/get-script entities
@@ -70,7 +71,10 @@
:height 10
:talk-color (color 0.9 0.3 0.9 1.0)}}
:guard (assoc (animation->texture screen guard-stand)
:x 70 :y 55 :baseline 185)
:x 70 :y 55 :baseline 185
:stand guard-stand
:talk guard-talk
:sleep guard-sleep)
:collision "outside-jail/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 40 0.001 1.3)
:start-pos [145 15]
@@ -78,4 +82,7 @@
(as-> entities entities
(if (= :night (get-in entities [:state :time]))
(assoc-in entities [:room :entities :guard] (get-in entities [:room :guard]))
entities)
(if (get-in entities [:state :dropped-ball?])
(update-in entities [:room :entities :guard] #(actions/start-animation % :sleep))
entities))))))

View File

@@ -14,7 +14,7 @@
(let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})]
(println (:input-x screen) (:input-y screen) "->" x y)))
(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope])
(def +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope :crowbar])
(defn cursor [filename which]
(let [scale 2