first step at dialogue trees.
This commit is contained in:
@@ -155,18 +155,49 @@
|
||||
(aget peddler-sheet 0 i)))
|
||||
peddler-stand (animation 0.2 (for [i (flatten [(repeat 5 0) 6])]
|
||||
(aget peddler-sheet 0 i)))
|
||||
wizard (texture "wizard.png")
|
||||
_ (texture! wizard :flip true false)]
|
||||
wizard-sheet (texture! (texture "wizard/talk.png") :split 20 46)
|
||||
wizard-stand (animation 0.2 (for [i (flatten [(repeat 10 0) 1])]
|
||||
(aget wizard-sheet 0 i)))
|
||||
wizard-talk (animation 0.2 (for [i [0 2 0 2 1 2 0 3 0 2 0 1 0 2]]
|
||||
(aget wizard-sheet 0 i)))]
|
||||
{:inside-house
|
||||
(make-background :interactions {:down-dir {:box [151 0 320 20]
|
||||
:script (actions/get-script entities
|
||||
(actions/walk-to entities :ego [237 1])
|
||||
(actions/transition-background entities :outside-house [262 88]))
|
||||
:cursor :down}}
|
||||
:cursor :down}
|
||||
:wizard {:box [228 80 248 126]
|
||||
:script (actions/get-script entities
|
||||
(actions/talk entities :ego "Hello there Fangald!")
|
||||
(actions/talk entities :wizard "Oh no, not you again!")
|
||||
(actions/present-choices entities "You're not my friend, Mr. Fangald?"
|
||||
(actions/get-script entities
|
||||
(actions/talk entities :ego "You're not my friend, Mr. Fangald?")
|
||||
(actions/talk entities :wizard "No, you are a rascally little boy who is nothing but a cheat!")
|
||||
(actions/present-choices entities
|
||||
"Oh, come on, I'm not that bad."
|
||||
(actions/get-script entities
|
||||
(actions/talk entities :ego "Oh, come on, I'm not that bad.")
|
||||
(actions/talk entities :wizard "Yes you are. Shoo!"))
|
||||
"I'm sorry."
|
||||
(actions/get-script entities
|
||||
(actions/talk entities :ego "I'm sorry")
|
||||
(actions/talk entities :wizard "That's better. Now scram."))
|
||||
))
|
||||
"Yes, it's me!"
|
||||
(actions/get-script entities
|
||||
(actions/talk entities :ego "Yes, it's me!")
|
||||
(actions/talk entities :wizard "Great, just great. Leave me alone."))))}}
|
||||
: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)]
|
||||
:entities {:wizard (assoc wizard :x 228 :y 80 :baseline 160 :scale-x 1.75 :scale-y 1.75)}
|
||||
:entities {:wizard (actions/start-animation screen (assoc (animation->texture screen wizard-stand) :x 228 :y 80 :baseline 160 :scale-x 1.75 :scale-y 1.75
|
||||
:left {:talk (flip wizard-talk)
|
||||
:stand (flip wizard-stand)}
|
||||
:right {:talk wizard-talk
|
||||
:stand wizard-stand}
|
||||
:facing :left)
|
||||
:stand)}
|
||||
:collision "inside-house/collision.png"
|
||||
:scale-fn (scaler-fn-with-baseline 110 0.10 1.75))
|
||||
:outside-house
|
||||
@@ -312,7 +343,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
|
||||
:actions {:object nil
|
||||
@@ -361,4 +392,8 @@
|
||||
(if (= (button-code :right)
|
||||
(:button screen))
|
||||
(assoc-in entities [:cursor :current] :main)
|
||||
(left-click screen entities))))
|
||||
(left-click screen entities)))
|
||||
|
||||
:on-start-script (fn [{:keys [script]} [entities] ]
|
||||
(script entities)
|
||||
entities))
|
||||
|
||||
Reference in New Issue
Block a user