Nice little tweaks for writing Brian.

This commit is contained in:
Bryce Covert
2015-08-06 20:14:35 -07:00
parent 0a268bb382
commit 274d5b0b26
7 changed files with 73 additions and 13 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
<dict>
<key>duration</key>
<real>1</real>
</dict>
</array>
</plist>

View File

@@ -12,6 +12,30 @@
[play-clj.ui :refer :all]
[play-clj.utils :refer :all]
[play-clj.g2d :refer :all]))
(defn brian [screen entities]
(when (and (not (get-in entities [:actions :script-running?]))
(get-in entities [:state :active?])
(get-in entities [:room :entities :game-player]))
((actions/get-script entities
((rand-nth [#(actions/do-dialogue entities :game-player "2 to the power of pi."
:game-player "No, that's not right.")
#(actions/do-dialogue entities :game-player "Eureka!"
:game-player "It's been staring at me in the face!"
:game-player "It's E=mc2!")
#(actions/do-dialogue entities :game-player "Now, according to Croutonian physics..."
:game-player "There are three states of matter."
:game-player "Solid, liquid, and ..."
:game-player "What was that last one?"
:game-player "Oh yeah, jelly."
:game-player "Brian, you're a genius!")
#(actions/do-dialogue entities :game-player "Considering the inverse square law..."
:game-player "I estimate our planet's escape velocity to be..."
:game-player "No, that can't be right.")]))
)
entities))
nil)
(defn get-chorus-volume [entities]
(let [ego (get-in entities [:room :entities :ego])]
(cond (> (:y ego) 112)
@@ -93,9 +117,11 @@
(defn do-game-player-dialogue [entities]
(walk-to-player entities)
(actions/do-dialogue entities :ego "You there!"
:game-player "... Oh, hello Tick. "
:game-player "What is it?")
(actions/do-dialogue entities :ego "You there!")
(actions/talk entities :game-player "What is it? I'm busy!" :anim :talk-down)
(Thread/sleep 200)
(actions/do-stop entities :game-player :face :right)
(actions/talk entities :game-player "Oh, it's you Tick.")
(actions/present-choices entities
{:choices ["Do you know anything about the sword in the stone up there?"
{:run #(actions/respond entities %
@@ -138,7 +164,8 @@
:game-player "'Hippity-hop, I'd jump so high,\nWithout these springs, can't harm a fly.'")
:choices actions/previous-choices}
"Nevermind."
{:run #(actions/respond entities % :game-player "See you around.")}]}))
{:run #(actions/respond entities % :game-player "See you around.")}]})
(actions/do-stop entities :game-player :face :left))
(defn walk-to-blergh [entities]
(actions/walk-to entities :ego [85 145] :face :right)
@@ -236,11 +263,13 @@
(defn make [screen]
(let [game-player-talk-sheet (texture! (texture "inside-castle/game-player-talk.png") :split 40 44)
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]]
game-player-talk-up (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]]
(aget game-player-talk-sheet 0 i)))
game-player-stand (animation 0.15 (for [i [0 0 0 0 0 0 0 0 0 0 0 1]]
game-player-stand-up (animation 0.15 (for [i [0 0 0 0 0 0 0 0 0 0 0 1]]
(aget game-player-talk-sheet 0 i)))
game-player-stand-down (utils/make-anim "inside-castle/brian-working.png" [40 44] 0.1 [0 1 1 2 0 2 2 1 0 2 2 2 2 2 1 1 ])
game-player-talk-down (utils/make-anim "inside-castle/brian-working.png" [40 44] 0.2 [2 3 2 2 3 2 3 2])
game-player-flex (animation 0.075 (for [i [0 0 4 4 5 5 5 5 5 5 5 6 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 9 7 8 7 6 5 5 5 5 5 5 5 5 5 5 4 4 0 0 0 0]]
(aget game-player-talk-sheet 0 i)))
trophy (utils/make-anim "inside-castle/trophy.png" [16 16] 0.1 (flatten [(repeat 50 0) 1 2 3 3 3 3 2 1]))
@@ -249,6 +278,7 @@
door (utils/make-anim "inside-castle/door.png" [21 49] 0.15 (flatten [(range 4) 3 3 3 3 3 3 3]))
]
(rooms/make :music {:day :town-1 :night :night :sunrise :night}
:timers {:brian [10.0 20.0 brian]}
:interactions
{:right-door {:box [286 140 306 160]
:cursor :right
@@ -397,7 +427,7 @@
(actions/play-animation entities :ego :end-squat)))
:trophy (assoc (animation->texture screen trophy)
:x 253 :y 69 :baseline 191
:x 233 :y 69 :baseline 191
:anim trophy
:anim-start 0
:script (actions/get-script entities
@@ -409,8 +439,9 @@
(actions/do-dialogue entities :ego "Can't you give me your trophy of wisdom?"
:game-player "If you want my trophy, you'll have to help me with my riddles."))))
:game-player (assoc (texture "inside-castle/gameplayer.png") :x 266 :y 49 :baseline 191
`:talk-color (color 1.0 0.3 0.2 1.0)
:talk-color (color 1.0 0.3 0.2 1.0)
:script (actions/get-script entities (do-game-player-dialogue entities))
:facing :left
:scripts #(condp = %
:wool (actions/get-script entities
(walk-to-player entities)
@@ -463,12 +494,19 @@
:done (actions/do-dialogue entities :game-player "I've gotten all the help I need with riddles today.")
nil (actions/do-dialogue entities :game-player "Why are you offering me this?")
(actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking."))))
:anim game-player-stand
:anim game-player-stand-down
:anim-start 0
:stand game-player-stand
:anim-sound-frames {game-player-stand {11 [:blink 0.3] }}
:flex game-player-flex
:talk game-player-talk)}
:anim-merges {game-player-stand-down {:origin-x 8}
game-player-stand-up {:origin-x 3}
game-player-talk-up {:origin-x 3}
game-player-talk-down {:origin-x 8}
game-player-flex {:origin-x 3}}
:left {:stand game-player-stand-down
:talk game-player-talk-down}
:right {:stand game-player-stand-up
:talk game-player-talk-up}
:anim-sound-frames {game-player-stand-up {11 [:blink 0.3] }}
:flex game-player-flex)}
:monocle (rooms/make-entity :monocle (assoc (animation->texture screen monocle)
:x 209 :y 160 :baseline 240
:anim monocle