new dialogue stuff.
This commit is contained in:
@@ -8,16 +8,64 @@
|
|||||||
[play-clj.utils :refer :all]
|
[play-clj.utils :refer :all]
|
||||||
[play-clj.g2d :refer :all]))
|
[play-clj.g2d :refer :all]))
|
||||||
|
|
||||||
|
(defn do-game-player-dialogue [entities]
|
||||||
|
(actions/do-dialogue entities :ego "You there!" :game-player "... Yes?")
|
||||||
|
(actions/present-choices entities
|
||||||
|
{:choices ["Do you know anything about the sword in the stone up there?"
|
||||||
|
{:run #(actions/respond entities %
|
||||||
|
:game-player "It is said that only he who is worthy in wisdom can pull the sword!"
|
||||||
|
:game-player "I, of course have such wisdom, but I'm still unable to pull it myself.")
|
||||||
|
:choices ["Can you teach me your ways?"
|
||||||
|
{:run #(actions/respond entities %
|
||||||
|
:game-player "Ha! My intellect has only been achieved with years of precise training!"
|
||||||
|
:game-player "You're out of luck, friend. Unless you are willing to spend hours and hours in careful study, you will always be a dunce."
|
||||||
|
:ego "...")
|
||||||
|
:choices actions/previous-choices}
|
||||||
|
"How come?"
|
||||||
|
{:run #(actions/respond entities %
|
||||||
|
:game-player "You must be mighty in strength to pull the sword."
|
||||||
|
:game-player "And I spend all of my time either playing my game, or at the library.")
|
||||||
|
:choices actions/previous-choices}
|
||||||
|
"Something else."
|
||||||
|
{:choices actions/something-else}]}
|
||||||
|
"What are you playing?"
|
||||||
|
{:run #(actions/respond entities %
|
||||||
|
:game-player "It's called Warlock's Castle. "
|
||||||
|
:game-player "You play as a warlock, using skills and magic to reach the top of the tower of doom."
|
||||||
|
:game-player "If you want to reach the top of the tower, you must have the sharpest of minds."
|
||||||
|
:game-player "It's not for little kids like you."
|
||||||
|
:game-player "Even wise wizards like Mr. Fangald can't beat me!")
|
||||||
|
:choices ["Can I play with you?"
|
||||||
|
{:run #(actions/respond entities %
|
||||||
|
:game-player "You think YOU have what it takes to climb the stairs of treachery?"
|
||||||
|
:game-player "Or solve the riddle in the library of mystery?"
|
||||||
|
:game-player "Or break the curse that has entrapped the cave beast for 1000 years?"
|
||||||
|
:game-player "Very well.")}
|
||||||
|
"That sounds pretty dumb."
|
||||||
|
{:run #(actions/respond entities %
|
||||||
|
:game-player "That's exactly what I'd expect a dummy like you to say."
|
||||||
|
:choices actions/previous-choices)}
|
||||||
|
"Something else."
|
||||||
|
{:choices actions/something-else}]}
|
||||||
|
"Nevermind."
|
||||||
|
{:run #(actions/respond entities % :game-player "See you around.")}]}))
|
||||||
|
|
||||||
(defn make [screen]
|
(defn make [screen]
|
||||||
(rooms/make :interactions
|
(let [game-player-talk-sheet (texture! (texture "inside-castle/game-player-talk.png") :split 40 44)
|
||||||
{:right-door {:box [286 140 306 160]
|
game-player-talk (animation 0.15 (for [i [0 2 0 2 0 2 0 3 0 2 0 1 0 0 0 0 2 0 2 0 3 0 1 0 1 0 0 1 0 2 0 3 0]]
|
||||||
:cursor :right
|
(aget game-player-talk-sheet 0 i)))]
|
||||||
:script (actions/get-script entities
|
(rooms/make :interactions
|
||||||
(actions/walk-to entities :ego [284 145])
|
{:right-door {:box [286 140 306 160]
|
||||||
(actions/transition-background entities :outside-castle [82 180])
|
:cursor :right
|
||||||
(actions/walk-to entities :ego [129 148]))}}
|
:script (actions/get-script entities
|
||||||
:layers [(assoc (texture "inside-castle/background.png") :x 0 :y 0 :baseline 0)
|
(actions/walk-to entities :ego [284 145])
|
||||||
(assoc (texture "inside-castle/pedestal-overlay.png") :x 0 :y 0 :baseline 135)]
|
(actions/transition-background entities :outside-castle [82 180])
|
||||||
:entities {:game-player (assoc (texture "inside-castle/gameplayer.png") :x 266 :y 49 :baseline 191)}
|
(actions/walk-to entities :ego [129 148]))}}
|
||||||
:collision "inside-castle/collision.png"
|
:layers [(assoc (texture "inside-castle/background.png") :x 0 :y 0 :baseline 0)
|
||||||
:scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00)))
|
(assoc (texture "inside-castle/pedestal-overlay.png") :x 0 :y 0 :baseline 135)]
|
||||||
|
:entities {:game-player (assoc (texture "inside-castle/gameplayer.png") :x 266 :y 49 :baseline 191
|
||||||
|
:script (actions/get-script entities (do-game-player-dialogue entities))
|
||||||
|
:anim nil
|
||||||
|
:talk game-player-talk)}
|
||||||
|
:collision "inside-castle/collision.png"
|
||||||
|
:scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00))))
|
||||||
|
|||||||
Reference in New Issue
Block a user