a better approach to dialogue treees.
This commit is contained in:
@@ -151,7 +151,7 @@
|
||||
(if (= :choices subject)
|
||||
(apply actions/present-choices entities (for [choice (partition 2 arg)]
|
||||
[(first choice) (actions/get-script entities
|
||||
(run-dialogue-tree entities (second choice) (first choice)))]))
|
||||
(run-dialogue-tree entities (doto (second choice) println) (first choice)))]))
|
||||
(if (= :line arg)
|
||||
(actions/talk entities subject previous-line)
|
||||
(actions/talk entities subject arg))))))
|
||||
@@ -179,28 +179,18 @@
|
||||
:cursor :down}
|
||||
:wizard {:box [228 80 248 126]
|
||||
:script (actions/get-script entities
|
||||
(run-dialogue-tree entities [:ego "Hello there Mr. Fangald!"
|
||||
:wizard "Oh no, not you again!"
|
||||
:choices ["You're not happy to see me?" [:ego :line
|
||||
:wizard "Of course not!"
|
||||
:wizard "Not after all the hell you've put me through."
|
||||
:choices ["You mean the time I set your rabbit loose?" [:ego :line
|
||||
:wizard "Fluffy was my best rabbit!"]
|
||||
"You're not still sore about my stealing your magic cowboy hat." [:ego :line
|
||||
:ego "Are you?"
|
||||
:wizard "That cowboy hat was one of a kind!"
|
||||
:wizard "Truly unique."
|
||||
:wizard "It accented my unique facial physique."
|
||||
:wizard "And now it's gone forever."
|
||||
:wizard "Leave me to die in peace."]
|
||||
"You mean the time I set your house on fire with a fire mint?" [:ego :line
|
||||
:wizard "That was you? I spent a fortune cleaning up the mess you made!"
|
||||
:wizard "You ruined my life work!"]
|
||||
|
||||
"An old hoot like you needs a kick the pants every now and again!" [:ego :line
|
||||
:wizard "Maybe so, but not from a cheating little boy like you!"]]]
|
||||
"What do you mean, 'not you again'?" [:ego :line
|
||||
:wizard "I mean get lost kid."]]]))}}
|
||||
(actions/present-choices entities {:choices {"Hello there" {:run #(do (actions/talk entities :ego %)
|
||||
(actions/talk entities :wizard "Oh, hello."))
|
||||
:choices {"How are you doing?" {:run #(do (actions/talk entities :ego %)
|
||||
(actions/talk entities :wizard "I'm ok."))
|
||||
:choices actions/previous-choices}
|
||||
"Any news?" {:run #(do (actions/talk entities :ego %)
|
||||
(actions/talk entities :wizard "Not really"))
|
||||
:choices actions/previous-choices}
|
||||
"Something Else" {:choices actions/something-else}}}
|
||||
"Good bye" {:run #(actions/talk entities :ego %)}}})
|
||||
|
||||
)}}
|
||||
:layers [(assoc (texture "inside-house/background.png") :x 0 :y 0 :baseline 0)
|
||||
(assoc (texture "inside-house/desk.png") :x 0 :y 0 :baseline 200)
|
||||
(assoc (texture "inside-house/sillhoute.png") :x 0 :y 0 :baseline 240)]
|
||||
@@ -356,7 +346,7 @@
|
||||
(update! screen :renderer (stage) :camera (orthographic))
|
||||
(let [_ (input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0)
|
||||
music (sound "town-music.mp3")
|
||||
_ (sound! music :loop 0.20)
|
||||
;; _ (sound! music :loop 0.20)
|
||||
backgrounds (backgrounds screen)]
|
||||
{:backgrounds backgrounds
|
||||
:state {:object nil
|
||||
|
||||
Reference in New Issue
Block a user