more updates.

This commit is contained in:
Bryce Covert
2016-08-15 07:56:39 -07:00
parent d1106b5903
commit 2a0d6bcb28
25 changed files with 579 additions and 298 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,5 +1,11 @@
make sure to dissoc, sometimes item still appears hovering
cursor handling when tabbing back and forth
implement dragging out too
cursor starting in the black not being valid
sound duration on android
choosing interaction feels wrong - flies hard to touch
change hotspots as necessary
turn off desk hotspots if you don't have inventory
Fade out needs to start at 100 opacity
less common for gandarfs experiment
delay in update with label causes jumpiness

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 676 KiB

After

Width:  |  Height:  |  Size: 672 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 KiB

After

Width:  |  Height:  |  Size: 609 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 414 KiB

After

Width:  |  Height:  |  Size: 419 KiB

View File

@@ -17,7 +17,7 @@
(defn make-left-dir [box]
{:box box
:script (actions/get-script
:only-script (actions/get-script
entities
(actions/walk-to entities :ego [122 140] :skip-type :end)
(actions/transition-background entities :outside-house [244 150])
@@ -42,6 +42,8 @@
entities
)}
:mushrooms {:box [247 59 269 76]
:label "Mushrooms"
:cursor :hand
:script (actions/get-script
entities
(if (actions/has-obtained? entities :mushrooms)
@@ -52,6 +54,8 @@
(actions/give entities :mushrooms)
(actions/talk entities :ego "Perfectly ripe mushrooms!"))))}
:window {:box [109 100 130 153]
:label "Window"
:cursor :look
:script (actions/get-script
entities
(actions/walk-to entities :ego [128 100] :face :left)
@@ -87,6 +91,8 @@
(assoc (utils/get-texture "behindhouse/fg2.png") :x (- 320 122) :y 0 :baseline 240 :parallax 1.5)]}
:entities {:stick (assoc (utils/get-texture "behindhouse/stick.png")
:x 26 :y 80 :baseline 160
:label "Stick"
:cursor :hand
:script (actions/get-script entities
(actions/walk-to entities :ego [50 80])
(actions/play-animation entities :ego :reach)
@@ -96,6 +102,8 @@
:peeling (assoc (utils/get-texture "behindhouse/house-cover.png")
:x 60 :y 92 :baseline 148
:label "Crumbly wall"
:cursor :hand
:script (actions/get-script entities
(cond (= :night (get-in @entities [:state :time]))
(actions/talk entities :ego "The house is empty right now.")

View File

@@ -225,6 +225,7 @@
(defn make-ladder-area [box]
{:box box
:cursor :hand
:label "Tree"
:script (actions/get-script entities
(actions/walk-to entities :ego [144 58] )
(actions/talk entities :ego "Maybe I can climb it!")
@@ -270,7 +271,7 @@
:ladder ladder-entity
:blank (rooms/make-entity :blank
{:object nil :x 0 :y 0 :width 320 :height 240 :baseline 240
:script (actions/get-script entities
:only-script (actions/get-script entities
(when (get-in @entities [:room :entities :ladder])
(actions/talk entities :ego "I'll get down.")
(get-down entities)))})
@@ -293,6 +294,7 @@
:rock {:box [62 83 101 103]
:cursor :hand
:label "Suspicous looking rock"
:script (actions/get-script entities
(when (and (actions/has-obtained? entities :note-1)
(not (actions/has-obtained? entities :walkie-talkies)))
@@ -313,6 +315,7 @@
(actions/do-dialogue entities :ego "I wonder what all of these magic devices do.")))}
:grass {:box [26 105 60 160]
:cursor :hand
:label "Grass"
:script (actions/get-script entities
(if (not (actions/has-obtained? entities :grass))
(do
@@ -324,6 +327,7 @@
(actions/talk entities :ego "I don't really need any more grass.")))}
:grandma {:box [109 33 132 98]
:cursor :talk
:label "Damsel"
:script (actions/get-script entities (do-grandma-dialogue entities))
:scripts #(condp = %
:kiss
@@ -348,6 +352,7 @@
:cat (actions/start-animation screen
(assoc (animation->texture screen cat-stand)
:x 184 :y 173 :baseline 1000
:label "Smuffle Wuffles"
:cursor :talk
:walk cat-walk
:stand cat-stand
@@ -426,6 +431,7 @@
:x 194 :y 188 :baseline 241)}
:owl (rooms/make-entity :owl (assoc (animation->texture screen owl-stand)
:x 187 :y 172 :baseline 241
:label "Owl"
:stand owl-stand
:talk owl-talk
:puke owl-puke

View File

@@ -370,6 +370,8 @@
(rooms/make :music {:intro :wind :day :dream}
:name "Dream"
:interactions {:pit {:box [54 0 219 36]
:label "Pit of destiny"
:cursor :look
:script (actions/get-script entities
(actions/walk-to entities :ego [154 41])
(actions/talk entities :ego "Wow! That's a long way down."))
@@ -425,6 +427,8 @@
:clouds (assoc (particle-effect "particles/cloudy2") :x 160 :y 120 :baseline 241)
:case (assoc (utils/get-texture "dream/case.png")
:x 144 :y 122 :baseline 139
:label "Glass case"
:cursor :look
:script (actions/get-script entities
(read-sword-plaque entities))
:scripts {:shovel (actions/get-script entities
@@ -480,6 +484,8 @@
:update-fn (partial utils/update-path-location 0.30)
:baseline 240
:label "Broom"
:cursor :hand
:script (actions/get-script entities
(if ((get-in @entities [:state :plaques-read]) :broom)
(do
@@ -495,6 +501,8 @@
:update-fn (partial utils/update-path-location 0.33)
:baseline 240
:laber "Shovel"
:cursor :hand
:script (actions/get-script entities
(if ((get-in @entities [:state :plaques-read]) :shovel)
(do
@@ -506,9 +514,9 @@
(read-shovel-plaque entities))))
:sign (assoc (utils/get-texture "dream/sign.png") :x 229 :y 33 :baseline 207)
:plaque-1 (assoc (utils/get-texture "dream/plaque1.png") :x 39 :y 99 :baseline 139 :script (actions/get-script entities (read-shovel-plaque entities)))
:plaque-2 (assoc (utils/get-texture "dream/plaque2.png") :x 147 :y 104 :baseline 139 :script (actions/get-script entities (read-sword-plaque entities)))
:plaque-3 (assoc (utils/get-texture "dream/plaque3.png") :x 283 :y 98 :baseline 139 :script (actions/get-script entities (read-broom-plaque entities)))
:plaque-1 (assoc (utils/get-texture "dream/plaque1.png") :x 39 :y 99 :baseline 139 :label "Plaque" :cursor :look :script (actions/get-script entities (read-shovel-plaque entities)))
:plaque-2 (assoc (utils/get-texture "dream/plaque2.png") :x 147 :y 104 :baseline 139 :label "Plaque" :cursor :look :script (actions/get-script entities (read-sword-plaque entities)))
:plaque-3 (assoc (utils/get-texture "dream/plaque3.png") :x 283 :y 98 :baseline 139 :label "Plaque" :cursor :look :script (actions/get-script entities (read-broom-plaque entities)))
:outside-particles (common/make-outside-particles)
:bounce-surrogate {:object nil
:path (catmull-rom-spline (map #(apply vector-2* %) [[200 130] [200 150]]) true)
@@ -551,6 +559,8 @@
(assoc-in e [:offset-y] (* (:scale-y e) (get-in es [:bounce-surrogate :delta-y] 0))))
:talk-color (Color/valueOf "ADA6FFFF")
:label "Fairy godfather"
:cursor :talk
:script (actions/get-script entities
(if (get-in @entities [:room :entities :fairy-godfather :distracted?])
(actions/do-dialogue entities :ego "He wouldn't be able to hear me from there.")

View File

@@ -62,6 +62,8 @@
(rooms/make :music :fight
:name "Held"
:interactions {:bloodclot {:box [182 42 270 196]
:label "Bloodclot"
:cursor :talk
:script (actions/get-script entities
(bloodclot-talk-script entities))
:scripts #(condp = %

View File

@@ -204,6 +204,8 @@
:x 255
:y 95
:baseline 160
:label "Choicest teddy bear"
:cursor :hand
:script (actions/get-script entities
(actions/walk-to entities :ego [242 49] :face :right)
(actions/play-animation entities :ego :reach)
@@ -224,7 +226,7 @@
:interactions
{:right {:box [250 0 320 75]
:cursor :right
:script (actions/get-script entities
:only-script (actions/get-script entities
(when (or (actions/has-item? entities :portrait)
(has-to-return-teddy? entities))
(actions/walk-to entities :ego [235 15])
@@ -239,6 +241,8 @@
(actions/transition-background entities :inside-castle [182 90])
(actions/walk-to entities :ego [187 75]))}
:return-portrait-2 {:box [103 116 131 131]
:label "Desk"
:cursor :look
:script (actions/get-script entities (if (actions/has-item? entities :portrait)
(actions/talk entities :ego "The shopkeep's portrait used to sit there.")
(get-portrait entities)
@@ -249,12 +253,16 @@
:teddy (actions/get-script entities
(return-teddy entities))}}
:return-portrait {:box [103 70 206 116]
:label "Desk"
:cursor :look
:script (actions/get-script entities (actions/talk entities :ego "It's the shopkeep's desk."))
:scripts {:portrait (actions/get-script entities
(return-portrait entities))
:teddy (actions/get-script entities
(return-teddy entities))}}
:return-teddy {:box [227 90 301 105]
:cursor :look
:label "Shelf"
:script (actions/get-script entities
(actions/talk entities :ego "It's a shelf."))
:scripts {:teddy (actions/get-script entities
@@ -262,6 +270,8 @@
:portrait (actions/get-script entities
(return-portrait entities))}}
:window {:box [195 121 256 190]
:label "Window"
:cursor :hand
:script (actions/get-script entities
(actions/walk-to entities :ego [207 68] :face :right)
@@ -294,17 +304,25 @@
(actions/play-animation entities :ego :hold-up-to-window)
(actions/talk entities :ego "It's just too dim."))))}}
:grandfather-clock {:box [55 70 103 185]
:label "Grandfather clock"
:cursor :look
:script (actions/get-script entities
(actions/do-dialogue entities :ego "Cool grandfather clock!"
:shopkeep "It's quite the exquisite piece, isn't it?"))}
:shelf {:box [0 60 52 199]
:cursor :look
:label "Trinkets"
:script (actions/get-script entities
(actions/walk-to entities :ego [48 58])
(actions/talk entities :ego "All of these trinkets seem too bulky to fit in my pack."))}
:flowers {:box [178 115 188 143]
:label "Flowers"
:cursor :look
:script (actions/get-script entities
(actions/talk entities :ego "I've never been a fan of flowers."))}
:lian {:box [264 103 317 198]
:cursor :look
:label "Tapestry"
:script (actions/get-script entities
(actions/walk-to entities :ego [220 35] :face :right)
(actions/do-dialogue entities
@@ -317,6 +335,8 @@
(assoc (utils/get-texture "inside-antique/fg.png") :x 0 :y 0 :baseline 320 :parallax 1.5)
]
:entities {:shopkeep (actions/start-animation screen (assoc (animation->texture screen shopkeep-stand) :x 148 :y 122 :baseline 112
:label "Shopkeeper"
:cursor :talk
:stand shopkeep-stand
:scale-x 1.6
:scale-y 1.6
@@ -372,6 +392,8 @@
:x 165
:y 110
:baseline 125
:label "Mint bowl"
:cursor :hand
:script (actions/get-script entities
(if (= 3 (get-in @entities [:state :mints-eaten]))
(do (actions/walk-to entities :ego [159 58] :face :right)
@@ -419,6 +441,8 @@
:x 112
:y 114
:baseline 120
:cursor :hand
:label "Portrait"
:script (actions/get-script entities
(get-portrait entities))))
:teddy (rooms/make-entity :teddy teddy)

View File

@@ -207,7 +207,7 @@
:name "Cafeteria"
:interactions
{:right-dir {:box [272 45 320 120]
:script (actions/get-script
:only-script (actions/get-script
entities
(actions/walk-to entities :ego [319 50] :skip-type :end)
(actions/transition-background entities :inside-castle [65 150])
@@ -221,6 +221,8 @@
]
:entities {:warriors (actions/start-animation screen (assoc (animation->texture screen warriors-stand) :x 31 :y 36 :baseline 180
:cursor :talk
:label "Knights"
:left {:stand (utils/flip warriors-stand)
:talk (utils/flip warriors-stand)}
:right {:stand warriors-stand
@@ -239,8 +241,19 @@
:anim knight-a-stand
:anim-start 0
:talk knight-a-stand
:stand knight-a-stand)
:stand knight-a-stand
:label "Knights"
:cursor :talk
:talk-color (color 1.0 0.2 0.3 1.0)
:script (actions/get-script entities
(do-warrior-dialogue entities))
:scripts (constantly (actions/get-script entities
(actions/walk-to entities :ego [150 45] :face :left)
(actions/do-dialogue entities :warriors
"We are warriors. We coveteth not earthly possessions."))))
:ladder-guard (actions/start-animation screen (assoc (animation->texture screen ladder-guard-stand) :x 180 :y 70 :baseline 170
:cursor :talk
:label "On-duty knight"
:stand ladder-guard-stand
:talk ladder-guard-talk
:talk-color (color 0.2 0.6 1.0 1.0)
@@ -253,6 +266,8 @@
"No thank you, young sire."))))
:stand)
:ladder (assoc (utils/get-texture "inside-cafeteria/ladder.png") :x 205 :y 70 :baseline 170
:cursor :hand
:label "Ladder"
:script (actions/get-script entities
(actions/talk entities :ladder-guard "Do not toucheth, young sire.")))}
:collision "inside-cafeteria/collision.png"

View File

@@ -385,7 +385,7 @@
:interactions
{:right-door {:box [286 140 306 160]
:cursor :right
:script (actions/get-script entities
:only-script (actions/get-script entities
(actions/walk-to entities :ego [284 145] :skip-type :end)
(actions/walk-straight-to entities :ego [295 145])
(if (outside-castle/should-block? entities)
@@ -397,7 +397,7 @@
(actions/walk-straight-to entities :ego [82 180])
(actions/walk-to entities :ego [129 148] :skip-type :end))))}
:up-door {:box [50 150 70 170]
:script (actions/get-script entities
:only-script (actions/get-script entities
(actions/walk-to entities :ego [65 155] :skip-type :end)
(if (= :night (get-in @entities [:state :time]))
(actions/talk entities :ego "It's locked.")
@@ -406,7 +406,7 @@
:cursor :up}
:antique-door {:box [154 90 189 150]
:cursor :up
:script (actions/get-script entities
:only-script (actions/get-script entities
(actions/walk-to entities :ego [182 90] :face :left :skip-type :end)
(actions/play-animation entities :ego :reach)
(if (= :night (get-in @entities [:state :time]))
@@ -424,6 +424,8 @@
:shopkeep "Oh, you're not him."
:shopkeep "Welcome to Ye Olde Antique Shop.")))))}
:sword {:box [15 93 49 125]
:label "Pedestal"
:cursor :hand
:script (actions/get-script entities
(if (actions/has-item? entities :sword)
(actions/talk entities :ego "I already have the Sword of Blergh!")
@@ -436,26 +438,34 @@
(pull-sword entities)
(try-to-pull-sword entities missing-items obtained-items))))))}
:sign {:box [125 140 165 155]
:label "Sign"
:cursor :look
:script (actions/get-script entities
(actions/talk entities :ego "Ye Ol' Antique Shoppe."))}
:background-houses {:box [84 145 126 180]
:script (actions/get-script entities
:only-script (actions/get-script entities
(actions/walk-to entities :ego [81 148] :face :right :stop? false :skip-type :end)
(actions/walk-straight-to entities :ego [92 150] :face :right)
(actions/transition-background entities :outside-jail [159 -20])
(actions/walk-straight-to entities :ego [159 20]))
:cursor :right}
:mid-house {:box [217 125 250 180]
:cursor :look
:label "Billy's house"
:script (actions/get-script entities
(actions/do-dialogue entities
:ego "That's Billy Billigan's house."
:ego "He's probably still angry from when I put his dog in the dryer."))}
:frankie-house {:box [251 140 266 160]
:cursor :look
:label "Frankie's house"
:script (actions/get-script entities
(actions/do-dialogue entities
:ego "That's Frankie Rockfist's house."
:ego "The last time I saw him, he socked me one, right in the kisser."))}
:georgia-house {:box [271 150 286 170]
:cursor :look
:label "Georgia's house"
:script (actions/get-script entities
(actions/do-dialogue entities
:ego "That's Georgia McGorgeous' house."
@@ -530,6 +540,8 @@
:y 110
:baseline 95)
:walkie-talkie (assoc (utils/get-texture "inside-castle/walkie-talkie.png")
:label "Walkie-talkie"
:cursor :talk
:x 257
:y 135
:baseline 0
@@ -543,6 +555,8 @@
:trophy (assoc (animation->texture screen trophy)
:x 230 :y 69 :baseline 191
:label "Trophy"
:cursor :hand
:anim trophy
:anim-start 0
:script (actions/get-script entities
@@ -557,11 +571,15 @@
(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."))))
:books (assoc (utils/get-texture "inside-castle/books.png")
:label "Books"
:cursor :hand
:x 230 :y 30 :baseline 191
:script (actions/get-script entities
(walk-to-player entities)
(actions/talk entities :game-player "Don't touch my books!")))
:game-player (assoc (utils/get-texture "inside-castle/gameplayer.png") :x 266 :y 49 :baseline 191
:label "Brian O'Brainy"
:cursor :talk
:talk-color (color 1.0 0.3 0.4 1.0)
:script (actions/get-script entities (do-game-player-dialogue entities))
:writing-sound (utils/load-sound "inside-castle/writing.ogg")
@@ -651,6 +669,8 @@
game-player-flex {1 [:flex-sound 0.5]}}
:flex game-player-flex)}
:monocle (rooms/make-entity :monocle (assoc (animation->texture screen monocle)
:label "A reflective thing"
:cursor :hand
:x 209 :y 160 :baseline 240
:origin-x 9
:anim monocle

View File

@@ -140,13 +140,15 @@
(rooms/make :music :inside-fangald
:name "Inside house"
:interactions {:down-dir {:box [151 0 320 40]
:script (actions/get-script entities
:only-script (actions/get-script entities
(actions/update-state entities #(assoc % :wizard-left? false))
(actions/walk-to entities :ego [237 1] :stop? false :skip-type :end)
(actions/walk-straight-to entities :ego [245 -60])
(actions/transition-background entities :outside-house [257 90] :face :left))
:cursor :down}
:safe {:box [34 70 70 115]
:label "MagiSafe 2000"
:cursor :hand
:script (actions/get-script entities
(actions/walk-to entities :ego [59 65])
(if (get-in @entities [:room :entities :wizard])
@@ -159,12 +161,18 @@
(actions/talk entities :ego "How did that tune go again?")
(actions/play-safe entities))))}}
:knight {:box [71 70 102 190]
:cursor :look
:label "Armor"
:script (actions/get-script entities
(actions/talk entities :ego "Maybe when I am an older knight, Gandarf will give me his armor!"))}
:shelves {:box [215 100 320 220]
:cursor :look
:label "Shelves"
:script (actions/get-script entities
(actions/talk entities :ego "His shelves are full of books and strange ingredients."))}
:window {:box [119 120 203 190]
:label "Window"
:cursor :look
:script (actions/get-script entities
(actions/talk entities :ego "It's a really big window!"))}}
:layers [(assoc (utils/get-texture "inside-house/background.png") :x 0 :y 0 :baseline 0)
@@ -213,6 +221,8 @@
:baseline 200
:anim candle
:anim-start 0
:label "Candle"
:cursor :look
:script (actions/get-script entities (actions/do-dialogue entities :ego "It's just a candle.")))
:candle-aura (assoc (animation->texture screen candle-aura) :x 172 :y 97 :baseline 239 :additive? true :origin-x 13 :opacity 0.5 :anim candle-aura :anim-start 0)
:candle-smoke (doto (assoc (particle-effect "particles/candle") :x 172 :y 112
@@ -223,6 +233,8 @@
(particle-effect! :set-position 237 0))
:flask (assoc (utils/get-texture "inside-house/flask.png")
:x 265 :y 80 :baseline 240
:label "Flask"
:cursor :hand
:script (actions/get-script entities
(actions/remove-entity entities :flask)
(actions/give entities :flask-1)
@@ -231,6 +243,8 @@
:wizard "Sure."))))
:frog-legs (assoc (utils/get-texture "inside-house/frog-legs.png")
:x 180 :y 77 :baseline 240
:label "Frog legs"
:cursor :hand
:script (actions/get-script entities
(if (get-in @entities [:room :entities :wizard])
(actions/do-dialogue entities :wizard "Hey, I need those frog legs for one of my spells!")

View File

@@ -121,6 +121,7 @@
:warden "Be a good chap and let me rest.")
(actions/play-animation entities :warden :fall-asleep :stop? false)
(actions/begin-animation entities :warden :sleep)
(actions/update-state entities (fn [s] (assoc s :warden-sleeping? true))))}]}))
(defn get-key [ entities]
@@ -236,12 +237,16 @@
}
:interactions {
:lock {:box [172 102 190 124]
:label "Lock"
:cursor :hand
:script (actions/get-script entities
(actions/walk-to entities :ego [174 80] :face :right)
(actions/play-animation entities :ego :reach)
(actions/talk entities :ego "There's no helping it. It's locked."))
:scripts {:key (actions/get-script entities (open-lock entities))}}
:window {:box [98 110 118 140]
:label "Window"
:cursor :look
:script (actions/get-script entities
(actions/walk-to entities :ego [102 88] :face :right)
(actions/do-dialogue entities
@@ -318,6 +323,8 @@
:ego "The door locks without a key."
:ego "If I get caught, I won't be able to get out."))}}
:hay {:box [130 86 177 102]
:label "Hay"
:cursor :hand
:script (actions/get-script entities
(search-hay entities))
:scripts {:default (actions/get-script entities
@@ -327,6 +334,8 @@
(actions/do-dialogue entities :ego "I'm trying to escape."
:ego "Not help the next bloke who gets trapped here."))}}
:chest {:box [194 62 228 99]
:label "Chest"
:cursor :hand
:script (actions/get-script entities (touch-chest entities))
:scripts {:key (actions/get-script entities
(if (get-in @entities [:state :opened-bars?])
@@ -338,7 +347,7 @@
(actions/talk entities :ego "Not while I'm in this cell.")))}}
:door {:box [257 62 301 152]
:cursor :down
:script (actions/get-script entities (leave entities))}
:only-script (actions/get-script entities (leave entities))}
}
:layers [(assoc (utils/get-texture "inside-jail/background.png") :x 0 :y 0 :baseline 0 :night-profile :none)
@@ -383,6 +392,8 @@
18 [:blink 0.15]}
warden-sleep {0 [:inhale 0.1]
10 [:exhale 0.1]}}
:label "Warden"
:cursor :talk
:script (actions/get-script entities
(cond
(actions/has-item? entities :key) (actions/talk entities :ego "Shh! It's best not to wake him now.")
@@ -391,6 +402,7 @@
(actions/do-dialogue entities
:ego "Yoo-hoo! Mr. Warden?"
:ego "I guess he's really fast asleep!")
(actions/update-entities entities (fn [e] (assoc-in e [:room :entities :warden :cursor] :hand)))
(actions/update-state entities #(assoc % :warden-fast-asleep? true)))
:else (do (actions/walk-to entities :ego [103 82])
@@ -409,6 +421,8 @@
:ball-n-chain (assoc (utils/get-texture "inside-jail/ball-n-chain.png")
:x 80 :y 80 :baseline 160
:night-profile :none
:label "Ball-n-chain"
:cursor :hand
:script (actions/get-script entities
(actions/walk-to entities :ego [103 83] :face :left)
(actions/play-animation entities :ego :squat)
@@ -424,6 +438,8 @@
:night-profile :none)
:candle-aura (assoc (animation->texture screen candle-aura) :x 215 :y 130 :baseline 2
:additive? true :origin-x 13 :origin-y 13 :opacity 0.5 :anim candle-aura :anim-start 0 :night-profile :none
:label "Candle"
:cursor :look
:script (actions/get-script entities (actions/talk entities :ego "Just a candle."))
:scripts {:default (actions/get-script entities (actions/talk entities :ego "I might catch the place on fire."))})
:candle-smoke (doto (assoc (particle-effect "particles/candle") :x 215 :y 130
@@ -435,6 +451,8 @@
:x 300 :y 60 :baseline 175
:night-profile :none
:label "Crowbar"
:cursor :hand
:script (actions/get-script entities
(if (get-in @entities [:state :opened-bars?])
(do (actions/walk-to entities :ego [295 55] :face :right)
@@ -460,8 +478,10 @@
(if (actions/has-obtained? entities :crowbar)
(update-in entities [:room :entities] #(dissoc % :crowbar))
entities)
(if (get-in entities [:state :warden-sleeping?])
(update-in entities [:room :entities :warden] #(actions/start-animation % :sleep))
(if (get-in entities [:state :warden-fast-asleep?])
(-> entities
(update-in [:room :entities :warden] #(actions/start-animation % :sleep))
(update-in [:room :entities :warden] assoc :cursor :hand))
entities)
(if (get-in entities [:state :opened-bars?])
(update-in (remove-lock entities)

View File

@@ -62,13 +62,15 @@
:name "Inside stash"
:interactions
{:left-dir {:box [91 60 125 140]
:script (actions/get-script
:only-script (actions/get-script
entities
(actions/walk-straight-to entities :ego [118 96])
(actions/transition-background entities :outside-jail [200 97])
(actions/walk-straight-to entities :ego [167 100]))
:cursor :left}
:candle {:box [160 130 170 140]
:label "Candle"
:cursor :look
:script (actions/get-script
entities
(actions/talk entities :ego "Just a candle."))
@@ -85,6 +87,8 @@
:default (actions/get-script entities
(actions/talk entities :ego "Momma always told me not to play with fire."))}}
:chest {:box [151 107 180 124]
:label "Chest"
:cursor :hand
:script (actions/get-script entities (explore-chest entities))
:scripts {:sword (actions/get-script entities (actions/talk entities :ego "There's not enough room to swing my sword here."))
:crowbar (actions/get-script entities

View File

@@ -344,7 +344,7 @@
:name "Outside castle"
:interactions
{:right-dir {:box [280 40 320 140]
:script (actions/get-script
:only-script (actions/get-script
entities
(actions/walk-to entities :ego [310 80] :stop? false :skip-type :end)
(actions/walk-straight-to entities :ego [340 80])
@@ -352,17 +352,23 @@
(actions/walk-straight-to entities :ego [30 80]))
:cursor :right}
:door {:box [66 180 85 195]
:script (actions/get-script
:only-script (actions/get-script
entities
(go-through-gate entities))
:cursor :left}
:castle {:box [0 181 100 240]
:cursor :look
:label "Castle"
:script (actions/get-script entities
(actions/do-dialogue entities :ego "That's the town of Remington in the distance."))}
:wares {:box [69 75 97 110]
:cursor :look
:label "Wares"
:script (actions/get-script entities
(actions/talk entities :ego "That peddler has all kinds of strange trinkets."))}
:garden {:box [103 170 178 200]
:label "Garden"
:cursor :hand
:script (actions/get-script
entities
(if (actions/has-obtained? entities :carrot)
@@ -398,6 +404,8 @@
peddler-talk {23 [:scratch 0.15]
6 [:blink 0.3 0.8]
22 [:blink 0.3 0.8]}}
:cursor :talk
:label "Peddler"
:scratch (utils/load-sound "outside-castle/scratch.ogg")
:talk peddler-talk :stand peddler-stand
:talk-color (color 1.0 0.9 0.4 1.0)
@@ -421,6 +429,8 @@
:stand)
:steer (actions/start-animation screen (assoc (animation->texture screen steer-stand) :x 203 :y 155 :baseline 80
:label "Angus, the buff bull"
:cursor :hand
:stand steer-stand
:night-profile :sprite
:moo (utils/load-sound "outside-castle/moo.ogg")
@@ -455,6 +465,8 @@
(assoc (animation->texture screen balloon-stand)
:x 75
:y 100
:cursor :look
:label "Balloons"
:baseline 140
:stand balloon-stand
:script (actions/get-script entities
@@ -469,6 +481,8 @@
:flies (assoc (animation->texture screen flies-stand)
:x 201
:y 175
:label "Flies"
:cursor :look
:anim flies-stand
:anim-start 0
:baseline 240
@@ -490,6 +504,8 @@
(actions/talk entities :ego "Those flies seem to be attracted to Angus' stench."))
)}
:note (rooms/make-entity :note (assoc (utils/get-texture "outside-castle/note.png")
:label "Bingo card"
:cursor :hand
:x 198 :y 66 :baseline 174
:script (actions/get-script entities
(actions/walk-to entities :ego [210 79] :face :left)

View File

@@ -618,7 +618,7 @@
(aget sheep-walk-sheet 0 i)))
butterfly-stand (utils/make-anim "butterfly.png" [7 7] 0.1 [0 1])
cauldron (utils/make-anim "outsidehouse/cauldron.png" [50 38] 0.15 (range 4))
charcoal (utils/make-anim-seq "outsidehouse/charcoal" [18 18] 0.25 (range 4))
charcoal (utils/make-anim-seq "outsidehouse/charcoal" [24 18] 0.25 (range 4))
scaler (utils/scaler-fn-with-baseline 110 0.10 1.00)
lamb-stand (aget lamb-walk-sheet 0 0)
lamb-walk (animation 0.075 (for [i (range 4)]
@@ -843,7 +843,7 @@
:anim charcoal
:anim-start 0
:night-profile :none
:x 125 :y 73 :baseline 167
:x 119 :y 73 :baseline 167
:script (actions/get-script entities
(actions/walk-to entities :ego [120 73])
(actions/play-animation entities :ego :start-squat-2 :stop? false)
@@ -862,6 +862,7 @@
:wizard "Good job, Tick."))}}))
:note (rooms/make-entity :note (assoc (utils/get-texture "outsidehouse/note.png")
:x 277 :y 74 :baseline 160
:label "Paper airplane"
:cursor :hand
:night-profile :none
:script (actions/get-script entities

View File

@@ -105,7 +105,7 @@
(rooms/make :music {:day :town-1 :night :night}
:name "Fountain"
:interactions {:down-dir {:box [30 0 227 40]
:script (actions/get-script entities
:only-script (actions/get-script entities
(actions/walk-to entities :ego [159 5] :skip-type :end :stop? false)
(actions/walk-straight-to entities :ego [159 -20])
(actions/transition-background entities :inside-castle [92 150])
@@ -113,24 +113,34 @@
(actions/walk-to entities :ego [159 74] :skip-type :end))
:cursor :down}
:door {:box [22 42 46 124]
:script (actions/get-script entities
:cursor :left
:only-script (actions/get-script entities
(if (= :night (get-in @entities [:state :time]))
(actions/talk entities :ego "I do NOT want to go back in there!")
(do (actions/walk-to entities :ego [50 46])
(actions/talk entities :warden "NO VISITORS!"))))}
:window {:box [62 175 80 212]
:label "Window"
:cursor :look
:script (actions/get-script entities
(if (= :night (get-in @entities [:state :time]))
(actions/do-dialogue entities :ego "Boy am I glad to be out of there!"
:ego "They didn't even give me my one telephone call!")
(actions/talk entities :ego "I wonder if anyone is imprisoned up there?")))}
:sign {:box [5 173 61 199]
:label "Sign"
:cursor :look
:script (actions/get-script entities
(actions/talk entities :ego "J.A.I.L. Jail. Can't you read?"))}
:my-house {:box [89 128 118 179]
:label "House"
:cursor :look
:script (actions/get-script entities
(actions/talk entities :ego "That's my house. I'd rather play outside."))}
:sherrif-house {:box [138 143 160 168]
:label "Sherriff's house"
:cursor :look
:script (actions/get-script entities
(actions/do-dialogue entities
:ego "That's the Sheriff's house."
@@ -139,6 +149,8 @@
:ego "Or windows."
:ego "What's the big deal?"))}
:mchulk-house {:box [223 137 282 172]
:label "Captain McHulk's house"
:cursor :look
:script (actions/get-script entities
(actions/do-dialogue entities
:ego "That's Captain McHulk's house!"
@@ -146,6 +158,8 @@
:ego "If only I could be as strong as he is one day."
))}
:stump {:box [205 68 251 100]
:label "Stump"
:cursor :hand
:script (actions/get-script entities
(actions/walk-to entities :ego [170 71] :face :right)
(actions/walk-straight-to entities :ego [188 71] :face :right)
@@ -178,6 +192,8 @@
:frog-legs (actions/get-script entities (actions/talk entities :ego "They're already chopped up!"))
:broken-clock (actions/get-script entities (actions/talk entities :ego "It's already split in half!"))}}
:lever {:box [3 72 20 90]
:label "Candle"
:cursor :hand
:script (actions/get-script entities
(interact-with-lever entities))
:scripts {:rope (actions/get-script entities
@@ -202,14 +218,17 @@
(actions/talk entities :ego "Why would I want to burn that?")
(actions/talk entities :ego "The candle's not lit right now.")))}}
:end-of-rope {:box [177 101 185 108]
:label "Rope"
:cursor :hand
:script (actions/get-script entities (try-to-go-in-stash entities))}
:fountain {:box [150 126 193 170]
:label "Fountain"
:cursor :look
:script (actions/get-script entities
(actions/walk-to entities :ego [151 119] :face :right)
(actions/do-dialogue entities :ego "Some would say this is life-giving nectar."
:ego "... Me?"
:ego "I'd just as soon say it's nasty public fountain water.")
(actions/play-animation entities :ego :get-sick))
:ego "I'd just as soon say it's nasty public fountain water."))
:scripts {:flask-2 (actions/get-script entities
(actions/walk-to entities :ego [151 119] :face :right)
(actions/play-animation entities :ego :reach)
@@ -257,6 +276,8 @@
:stand guard-stand
:talk guard-talk
:sleep guard-sleep
:label "Knocked out guard"
:cursor :hand
:script (actions/get-script entities (search-guard entities))
:night-profile :sprite))
:rope (rooms/make-entity :rope (assoc (utils/get-texture "outside-jail/rope.png")
@@ -264,9 +285,13 @@
:spear (rooms/make-entity :spear (assoc (utils/get-texture "outside-jail/spear.png")
:night-profile :none
:x 60 :y 65 :baseline 180
:label "Spear"
:cursor :hand
:script (actions/get-script entities (grab-spear entities))))
:alarm-clock (rooms/make-entity :alarm-clock (assoc (utils/get-texture "outside-jail/alarm-clock.png")
:x 217 :y 83 :baseline 160
:label "Broken clock"
:cursor :hand
:script (actions/get-script entities
(actions/walk-to entities :ego [189 65] :face :right)
(actions/play-animation entities :ego :reach)
@@ -285,15 +310,30 @@
:apply-state (fn [screen entities]
(utils/fast-forward-particle (get-in entities [:room :entities :outside-particles]))
(as-> entities entities
(utils/play-sound! screen entities (get-in entities [:room :fountain-sound :sound])
(utils/sourced-volume-fn :fountain 0.06 [172 120])
(utils/get-sound-pan 172)
:loop)
(if (= :night (get-in entities [:state :time]))
(make-night entities)
(update-in entities [:room :entities] dissoc :candle-aura :candle-flame))
(if (get-in entities [:state :dropped-ball?])
(update-in entities [:room :entities :guard] #(actions/start-animation % :sleep))
(update-in entities [:room :entities] dissoc :bent-bar-window )))))))
(if (get-in entities [:state :knows-about-stash?])
(update-in entities [:room :interactions] (fn [xs]
(for [i xs]
(if (= (:id i)
:lever)
(assoc i :cursor :hand)
i))))
(update-in entities [:room :interactions] (fn [xs]
(for [i xs]
(if (= (:id i)
:lever)
(assoc i :cursor :look)
i)))))
(if (= :night (get-in entities [:state :time]))
(make-night entities)
(update-in entities [:room :entities] dissoc :candle-aura :candle-flame))
(if (get-in entities [:state :dropped-ball?])
(update-in entities [:room :entities :guard] #(actions/start-animation % :sleep))
(update-in entities [:room :entities] dissoc :bent-bar-window )))))))

View File

@@ -248,6 +248,8 @@
:explode bloodclot-explode
:label "Bloodclot"
:cursor :talk
:script (actions/get-script entities
(actions/do-dialogue entities
:bloodclot-head "No time to talk."

View File

@@ -176,6 +176,18 @@ void main ()
")
;
(defn ensure-on-screen [l]
(let [margin-width (* 0.05 320)
minimum-x margin-width
maximum-x (- 320 margin-width)
label-width (label! l :get-width)
label-right (+ (:x l) (/ label-width 2))
_ (println label-right)
l (cond (> label-right maximum-x) (assoc l :x (- maximum-x label-width))
(< (:x l) minimum-x) (assoc l :x minimum-x)
:else l)]
l))
(defn get-script-selector [entities]
(or (get-selected-inventory-item) :main))
@@ -909,7 +921,8 @@ void main ()
depressed?)))
(update-in entities [:cursor ] assoc
:last [new-current depressed?]
:time-changed total-time)))))
:time-changed total-time
:offset (utils/+cursor-hotspots+ (or (:cursor new-current) new-current) [0 0]))))))
(defn get-looped-animation-point ^double [^Animation animation ^double total-time]
@@ -1234,12 +1247,13 @@ void main ()
:music-override {:object nil
:value nil}
:label (utils/add-actor-to-stage screen
(assoc (label "Sheep" style :set-alignment Align/left)
(assoc (label "Sheep" style :set-alignment Align/center)
:x 0 :y 0 :baseline 10000))
:cursor {:id "cursor"
:last nil
:override :hourglass
:last-pos [0 0]
:offset [0 0 ]
:down-target nil}
:all-items (assoc items/items :object nil)
@@ -1278,7 +1292,7 @@ void main ()
nil)
:on-render
(fn [{:keys [^OrthographicCamera camera ^FitViewport viewport ^Stage renderer] :as screen} {{:keys [last-pos]} :cursor :keys [tweens] :as entities} options]
(fn [{:keys [^OrthographicCamera camera ^FitViewport viewport ^Stage renderer] :as screen} {{:keys [last-pos ] [cursor-offset-x cursor-offset-y] :offset} :cursor :keys [tweens] :as entities} options]
(steam/update)
(.apply viewport)
@@ -1320,9 +1334,13 @@ void main ()
last-pos-x (double last-pos-x)
last-pos-y (double last-pos-y)
entities (update-in entities [:label] assoc
:x (unchecked-add last-pos-x 20.0)
:y (unchecked-subtract last-pos-y 12 ))
entities (-> entities
(update-in [:label] assoc
:x (unchecked-subtract last-pos-x
cursor-offset-x)
:y (unchecked-add (unchecked-subtract last-pos-y 24 )
cursor-offset-y))
(update-in [:label] ensure-on-screen))
entities (if (and (@utils/settings :camera-man? true)

View File

@@ -48,7 +48,68 @@
(def ^:const +all-cursors+ [:main :wool :mushrooms :carrot :right :down :left :up :flask :flask-with-contents :trophy :ladder :stick :cat-toy :balloon :frog-legs :teddy :portrait :recipe :glass-eye :motivational-tapes :used-earplugs :grass :slobber :flask-with-strength :medal :kiss :sword :hourglass :mandrake :ball-n-chain :key :rope :crowbar :note-1 :ash :sack-lunch :flies :spear :monocle :feather :spell-component :money :charcoal :broken-clock :slingshot :camera :walkie-talkies :alarm-clock :walkie-talkie :flask-water :flask-water-stuff :flask-water-stuff-2 :note-2 :magic-slingshot :active-main :shovel :broom :tune :hand :hand-depressed :talk :talk-depressed :look :look-depressed])
(def ^:const +cursor-hotspots+ {:look [8 8]
:look-depressed [8 8]})
:look-depressed [8 8]
:wool [8 8]
:mushrooms [8 8]
:right [8 8]
:down [8 8]
:left [8 8]
:up [8 8]
:flask [8 8]
:flask-with-contents [8 8]
:trophy [8 8]
:ladder [8 8]
:stick
:cat-toy
:balloon [3 3]
:frog-legs [8 8]
:teddy [8 8]
:portrait [5 8]
:recipe [8 8]
:glass-eye [8 3]
:motivational-tapes [8 8]
:used-earplugs [8 8]
:grass [2 2]
:slobber [8 8]
:flask-with-strength [8 8]
:medal [8 8]
:kiss [8 8]
:sword [8 8]
:hourglass [0 0]
:mandrake [8 8]
:ball-n-chain [8 8]
:key [3 8]
:rope [8 8]
:crowbar [0 0]
:note-1 [8 8]
:ash [8 10]
:sack-lunch [8 8]
:flies [8 8]
:spear [0 0]
:monocle [8 8]
:feather [8 8]
:spell-component [8 8]
:money [8 8]
:charcoal [1 1]
:broken-clock [8 8]
:slingshot [8 8]
:camera [8 8]
:walkie-talkies [8 8]
:alarm-clock [8 8]
:walkie-talkie [8 8]
:flask-water [8 8]
:flask-water-stuff [8 8]
:flask-water-stuff-2 [8 8]
:note-2 [8 8]
:magic-slingshot [8 8]
:active-main [0 0]
:shovel [8 8]
:broom [0 0]
:tune [8 8]
:hand [3 0]
:hand-depressed [3 0]
:talk [8 8]
:talk-depressed [8 8]})
(def settings (atom {:music-volume 50.0
:sound-volume 75.0