Autosaving

This commit is contained in:
2014-11-22 13:57:05 -08:00
parent 54b1f1497a
commit 919871ddc3
11 changed files with 100 additions and 60 deletions

View File

@@ -137,7 +137,7 @@
:scripts {:wool (actions/get-script entities
(if (= :wool (get-in @entities [:state :current-riddle]))
(do (actions/update-state entities #(assoc % :current-riddle :balloon))
(actions/remove-item entities items/wool)
(actions/remove-item entities :wool)
(actions/do-dialogue entities
:game-player "That's right! Now for your second riddle:"
:game-player "Filled with air, light as a feather,"
@@ -146,7 +146,7 @@
:balloon (actions/get-script entities
(if (= :balloon (get-in @entities [:state :current-riddle]))
(do (actions/update-state entities #(assoc % :current-riddle :frog-legs))
(actions/remove-item entities items/balloon)
(actions/remove-item entities :balloon)
(actions/do-dialogue entities
:game-player "That's right! Now for your third riddle:"
:game-player "Hippity-hop, I jump really far,"
@@ -156,12 +156,12 @@
(if (= :frog-legs (get-in @entities [:state :current-riddle]))
(do (actions/update-state entities #(assoc % :current-riddle :done))
(actions/remove-item entities items/frog-legs)
(actions/remove-item entities :frog-legs)
(actions/do-dialogue entities
:game-player "Wow! That's right!"
:game-player "I guess I'm not the wisest person in Remington."
:game-player "You have earned my trophy.")
(actions/give entities items/trophy))
(actions/give entities :trophy))
(actions/talk entities :ego "He doesn't need it.")))}
:anim nil
:talk game-player-talk)}
@@ -169,6 +169,6 @@
:scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00)
:apply-state (fn [entities]
(as-> entities entities
(if (actions/has-item? entities items/ladder)
(if (actions/has-item? entities :ladder)
(update-in entities [:room :entities] #(dissoc % :ladder))
entities))))))