more tweaks.

This commit is contained in:
2015-04-21 18:31:40 -07:00
parent 7b6d0f7a88
commit 694da55a0d
4 changed files with 24 additions and 13 deletions

View File

@@ -161,6 +161,17 @@
(defn stop [screen entities target-id & {:keys [face]}] (defn stop [screen entities target-id & {:keys [face]}]
(update-in entities [:room :entities target-id] (comp #(start-animation screen % :stand) (if face #(assoc % :facing face) identity)))) (update-in entities [:room :entities target-id] (comp #(start-animation screen % :stand) (if face #(assoc % :facing face) identity))))
(defn do-stop [entities target-id & {:keys [face]}]
(run-action entities
(begin [this screen entities]
(update-in entities [:room :entities target-id]
(comp #(start-animation screen % :stand) (if face #(assoc % :facing face) identity))))
(continue [this screen entities] entities)
(done? [this screen entities] true)
(terminate [this screen entities]
entities)
(can-skip? [this screen entities]
false)))
@@ -320,8 +331,8 @@
(terminate [this screen entities] (terminate [this screen entities]
(stop screen entities target-id :face face)) (stop screen entities target-id :face face))
(can-skip? [this screen entities] (can-skip? [this screen entities]
(or can-skip? false))) (or can-skip? false)))
@entities))) (do-stop entities :ego :face face))))
(defn get-text-duration [text] (defn get-text-duration [text]
(* (count (s/split text #" ")) 0.5)) (* (count (s/split text #" ")) 0.5))
@@ -452,6 +463,8 @@
(can-skip? [this screen entities] (can-skip? [this screen entities]
false))) false)))
(defn update-state [entities f] (defn update-state [entities f]
(update-entities entities #(update-in % [:state] f))) (update-entities entities #(update-in % [:state] f)))

View File

@@ -113,7 +113,7 @@
(actions/update-state entities #(assoc % :wizard-left? false)) (actions/update-state entities #(assoc % :wizard-left? false))
(actions/walk-to entities :ego [237 1]) (actions/walk-to entities :ego [237 1])
(actions/walk-straight-to entities :ego [245 -60]) (actions/walk-straight-to entities :ego [245 -60])
(actions/transition-background entities :outside-house [262 88] :face :left)) (actions/transition-background entities :outside-house [257 90] :face :left))
:cursor :down} :cursor :down}
:safe {:box [34 70 70 115] :safe {:box [34 70 70 115]
:script (actions/get-script entities :script (actions/get-script entities

View File

@@ -142,7 +142,7 @@
:wizard "... a ..." :wizard "... a ..."
:wizard "... a frog!" :wizard "... a frog!"
:ego "Okay, okay! I'm leaving.") :ego "Okay, okay! I'm leaving.")
(actions/transition-background entities :outside-house [262 88]) (actions/transition-background entities :outside-house [257 90])
(actions/do-dialogue entities :ego "I guess he's really upset with me." (actions/do-dialogue entities :ego "I guess he's really upset with me."
:ego "I wonder if I can convince him to let me stay..."))} :ego "I wonder if I can convince him to let me stay..."))}
"You're still cross about my stealing your magic cowboy hat?" "You're still cross about my stealing your magic cowboy hat?"
@@ -153,7 +153,7 @@
:wizard "And you little pipsqueak stole it from me!" :wizard "And you little pipsqueak stole it from me!"
:wizard "That's why I bought my Magi-Safe 5000, to keep out intruders like you." :wizard "That's why I bought my Magi-Safe 5000, to keep out intruders like you."
:wizard "Now leave, before I get really angry!.") :wizard "Now leave, before I get really angry!.")
(actions/transition-background entities :outside-house [262 88]) (actions/transition-background entities :outside-house [257 90])
(actions/do-dialogue entities :ego "I guess he's really upset with me." (actions/do-dialogue entities :ego "I guess he's really upset with me."
:ego "I wonder if I can convince him to let me stay..."))} :ego "I wonder if I can convince him to let me stay..."))}
"Even an old hoot like you needs a kick in the pants every now and again." "Even an old hoot like you needs a kick in the pants every now and again."
@@ -165,14 +165,14 @@
:wizard "When you have a bod like man, you can hardly go to the grocery store without being noticed." :wizard "When you have a bod like man, you can hardly go to the grocery store without being noticed."
:wizard "But no. Your looks, however good they may be, don't give you the right to teach me a lesson." :wizard "But no. Your looks, however good they may be, don't give you the right to teach me a lesson."
:wizard "Now please leave me in peace.") :wizard "Now please leave me in peace.")
(actions/transition-background entities :outside-house [262 88]) (actions/transition-background entities :outside-house [257 90])
(actions/talk entities :ego "Gandarf is pretty upset, but I bet he can be reasoned with."))} (actions/talk entities :ego "Gandarf is pretty upset, but I bet he can be reasoned with."))}
"My good standing within the community?" "My good standing within the community?"
{:run #(do (actions/respond entities % {:run #(do (actions/respond entities %
:wizard "Ha! Good standing?" :wizard "Ha! Good standing?"
:wizard "You're the neighborhood cheat and everyone knows it." :wizard "You're the neighborhood cheat and everyone knows it."
:wizard "Now please leave me in peace.") :wizard "Now please leave me in peace.")
(actions/transition-background entities :outside-house [262 88]) (actions/transition-background entities :outside-house [257 90])
(actions/talk entities :ego "Gandarf is pretty upset, but I bet he can be reasoned with."))} (actions/talk entities :ego "Gandarf is pretty upset, but I bet he can be reasoned with."))}
"I'm going to be a knight! That counts for something doesn't it?" "I'm going to be a knight! That counts for something doesn't it?"
{:run #(do (actions/respond entities % {:run #(do (actions/respond entities %
@@ -209,7 +209,7 @@
{:run #(do (actions/respond entities % {:run #(do (actions/respond entities %
:wizard "While your goal sounds noble, no amount of bizarre conversation tree searching will earn my respect." :wizard "While your goal sounds noble, no amount of bizarre conversation tree searching will earn my respect."
:wizard "Now please leave.") :wizard "Now please leave.")
(actions/transition-background entities :outside-house [262 88]) (actions/transition-background entities :outside-house [257 90])
(actions/talk entities :ego "If only Gandarf could be tricked into seeing the valiant side of me..."))}]}]}]} (actions/talk entities :ego "If only Gandarf could be tricked into seeing the valiant side of me..."))}]}]}]}
"You're not happy to see me, Gandarf?" "You're not happy to see me, Gandarf?"
{:run #(actions/respond entities % :wizard "Of course not, you little brat. You've made my life a living hell!") {:run #(actions/respond entities % :wizard "Of course not, you little brat. You've made my life a living hell!")
@@ -217,7 +217,7 @@
"Goodbye, Gandarf!" "Goodbye, Gandarf!"
{:run #(do {:run #(do
(actions/respond entities % :wizard "Now scram!") (actions/respond entities % :wizard "Now scram!")
(actions/transition-background entities :outside-house [262 88]))}]})) (actions/transition-background entities :outside-house [257 90]))}]}))
(defn talk-to-gandarf-outside [entities] (defn talk-to-gandarf-outside [entities]
@@ -321,7 +321,7 @@
:script :script
(actions/get-unsaved-script (actions/get-unsaved-script
entities entities
(actions/walk-to entities :ego [257 90]) (actions/walk-to entities :ego [257 90] :face :right)
(actions/talk entities :ego (str "Anyone home?")) (actions/talk entities :ego (str "Anyone home?"))
(sound! (sound "door.ogg") :play (utils/current-sound-volume)) (sound! (sound "door.ogg") :play (utils/current-sound-volume))
(actions/play-animation entities :ego :reach) (actions/play-animation entities :ego :reach)

View File

@@ -159,10 +159,8 @@
:script (actions/get-script entities (try-to-go-in-stash entities))}} :script (actions/get-script entities (try-to-go-in-stash entities))}}
:layers {:day [(assoc (texture "outside-jail/background.png") :x 0 :y 0 :baseline 0)] :layers {:day [(assoc (texture "outside-jail/background.png") :x 0 :y 0 :baseline 0)]
:night [(assoc (texture "outside-jail/background-dark.png") :x 0 :y 0 :baseline 0)]} :night [(assoc (texture "outside-jail/background-dark.png") :x 0 :y 0 :baseline 0)]}
:entities {:fountain (assoc (texture "outside-jail/dot.png") #_(animation->texture screen fountain) :entities {:fountain (assoc (animation->texture screen fountain)
:x 150 :y 126 :baseline 114 :x 150 :y 126 :baseline 114
#_:anim fountain
#_:anim-start 0
:script (actions/get-script entities :script (actions/get-script entities
(actions/walk-to entities :ego [151 119] :face :right) (actions/walk-to entities :ego [151 119] :face :right)
(actions/play-animation entities :ego :reach) (actions/play-animation entities :ego :reach)