merged.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]))
|
||||
|
||||
(println "loading " *ns*)
|
||||
(defn brian [screen entities]
|
||||
(when (and (not (get-in entities [:fg-actions :script-running?]))
|
||||
(not (get-in entities [:bg-actions :script-running?]))
|
||||
@@ -360,32 +361,31 @@
|
||||
(do (actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking.")
|
||||
nil)))
|
||||
|
||||
(defn make [screen]
|
||||
(let [sign (utils/make-anim-seq "inside-castle/sign" [44 20] 0.3 (flatten [(repeat 20 0) 1 0 2 0 1 0 2 0 1 0 2 0 1]))
|
||||
game-player-talk-sheet (texture! (utils/get-texture "inside-castle/game-player-talk.png") :split 40 44)
|
||||
(defn make [screen atlas global-atlas]
|
||||
(let [sign (utils/make-anim-seq atlas "sign" [44 20] 0.3 (flatten [(repeat 20 0) 1 0 2 0 1 0 2 0 1 0 2 0 1]))
|
||||
game-player-talk-sheet (texture! (utils/atlas->texture atlas "game-player-talk") :split 40 44)
|
||||
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-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 (flatten (repeat 4 [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-pause-from-work (utils/make-anim "inside-castle/brian-working.png" [40 44] 0.15 [2 3 4 5 6 7])
|
||||
game-player-get-to-work (utils/make-anim "inside-castle/brian-working.png" [40 44] 0.15 (reverse [2 3 4 5 6 7]))
|
||||
game-player-stand-down (utils/make-anim atlas "brian-working" [40 44] 0.1 (flatten (repeat 4 [0 1 1 2 0 2 2 1 0 2 2 2 2 2 1 1 ])))
|
||||
game-player-talk-down (utils/make-anim atlas "brian-working" [40 44] 0.2 [2 3 2 2 3 2 3 2])
|
||||
game-player-pause-from-work (utils/make-anim atlas "brian-working" [40 44] 0.15 [2 3 4 5 6 7])
|
||||
game-player-get-to-work (utils/make-anim atlas "brian-working" [40 44] 0.15 (reverse [2 3 4 5 6 7]))
|
||||
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]))
|
||||
pull-sword-anim (utils/make-anim "inside-castle/pull-sword.png" [95 190] 0.10 (flatten [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 3 2 3 2 3 3 2 3 2 2 3 3 2 3 2 3 2 3 2 3 2 3 2 2 3 3 3 2 3 2 3 3 2 3 2 3 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ]))
|
||||
monocle (utils/make-anim "inside-castle/monocle.png" [19 19] 0.05 (flatten [(repeat 70 0) 1 2 3 3 3 2 1]))
|
||||
door (utils/make-anim "inside-castle/door.png" [21 49] 0.15 (flatten [(range 4) 3 3 3 3 3 3 3]))
|
||||
trophy (utils/make-anim atlas "trophy" [16 16] 0.1 (flatten [(repeat 50 0) 1 2 3 3 3 3 2 1]))
|
||||
pull-sword-anim (utils/make-anim atlas "pull-sword" [95 190] 0.10 (flatten [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 3 2 3 2 3 3 2 3 2 2 3 3 2 3 2 3 2 3 2 3 2 3 2 2 3 3 3 2 3 2 3 3 2 3 2 3 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ]))
|
||||
monocle (utils/make-anim atlas "monocle" [19 19] 0.05 (flatten [(repeat 70 0) 1 2 3 3 3 2 1]))
|
||||
door (utils/make-anim atlas "door" [21 49] 0.15 (flatten [(range 4) 3 3 3 3 3 3 3]))
|
||||
]
|
||||
(rooms/make :music {:day :town-1 :night :night :sunrise :night}
|
||||
:name "Inside castle"
|
||||
(rooms/make :name "Inside castle"
|
||||
:timers {:brian [10.0 7.0 brian]}
|
||||
: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,43 +438,51 @@
|
||||
(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."
|
||||
:ego "One day, when I'm a knight, she'll say...")
|
||||
(actions/georgia-say entities "Kiss me, brave Sir Tick!")
|
||||
#_(actions/in-love entities))}}
|
||||
:layers {:day [(assoc (utils/get-texture "inside-castle/background.png") :x 0 :y 0 :baseline 0)
|
||||
(assoc (utils/get-texture "inside-castle/way-back-tree.png") :x 0 :y 0 :baseline 97)
|
||||
(assoc (utils/get-texture "inside-castle/roof.png") :x (- 320 57) :y 0 :baseline 240 :parallax 1.5)
|
||||
(assoc (utils/get-texture "inside-castle/bookstack.png") :x 244 :y 67 :baseline 190 :origin-x 0 :origin-y 0)]
|
||||
:night [(assoc (utils/get-texture "inside-castle/background.png") :x 0 :y 0 :baseline 0)
|
||||
(assoc (utils/get-texture "inside-castle/way-back-tree.png") :x 0 :y 0 :baseline 97)
|
||||
(assoc (utils/get-texture "inside-castle/roof.png") :x (- 320 57) :y 0 :baseline 240 :parallax 1.5)]
|
||||
:sunrise [(assoc (utils/get-texture "inside-castle/background.png") :x 0 :y 0 :baseline 0)
|
||||
(assoc (utils/get-texture "inside-castle/way-back-tree.png") :x 0 :y 0 :baseline 97)
|
||||
(assoc (utils/get-texture "inside-castle/roof.png") :x (- 320 57) :y 0 :baseline 240 :parallax 1.5)]}
|
||||
:blackout (assoc (utils/get-texture "black.png")
|
||||
:layers {:day [(assoc (utils/atlas->texture atlas "background") :x 0 :y 0 :baseline 0)
|
||||
(assoc (utils/atlas->texture atlas "way-back-tree") :x 0 :y 0 :baseline 97)
|
||||
(assoc (utils/atlas->texture atlas "roof") :x (- 320 57) :y 0 :baseline 238 :parallax 1.5)
|
||||
(assoc (utils/atlas->texture atlas "bookstack") :x 244 :y 67 :baseline 190 :origin-x 0 :origin-y 0)]
|
||||
:night [(assoc (utils/atlas->texture atlas "background") :x 0 :y 0 :baseline 0)
|
||||
(assoc (utils/atlas->texture atlas "way-back-tree") :x 0 :y 0 :baseline 97)
|
||||
(assoc (utils/atlas->texture atlas "roof") :x (- 320 57) :y 0 :baseline 238 :parallax 1.5)]
|
||||
:sunrise [(assoc (utils/atlas->texture atlas "background") :x 0 :y 0 :baseline 0)
|
||||
(assoc (utils/atlas->texture atlas "way-back-tree") :x 0 :y 0 :baseline 97)
|
||||
(assoc (utils/atlas->texture atlas "roof") :x (- 320 57) :y 0 :baseline 238 :parallax 1.5)]}
|
||||
:blackout (assoc (utils/atlas->texture global-atlas "black")
|
||||
:x -10 :y -10
|
||||
:width 340
|
||||
:height 260 :opacity 0.8
|
||||
@@ -508,31 +518,33 @@
|
||||
(particle-effect! magic :allow-completion)
|
||||
entities)
|
||||
entities))}]
|
||||
:entities {:bird-1 (utils/make-bird screen (as-> [[185 235]
|
||||
:entities {:bird-1 (utils/make-bird screen global-atlas (as-> [[185 235]
|
||||
[220 225] [210 230] [250 235]] p
|
||||
(concat p (reverse p))))
|
||||
:sign (assoc (animation->texture screen sign )
|
||||
:anim sign
|
||||
:anim-start 0
|
||||
:x 125 :y 138 :baseline 239)
|
||||
:bird-2 (utils/make-bird screen (as-> [[220 225] [195 235] [210 230] [250 225]] p
|
||||
:x 125 :y 138 :baseline 237)
|
||||
:bird-2 (utils/make-bird screen global-atlas (as-> [[220 225] [195 235] [210 230] [250 225]] p
|
||||
(concat p (reverse p))))
|
||||
|
||||
:outside-particles (common/make-outside-particles)
|
||||
:door (assoc (animation->texture screen door)
|
||||
:door (assoc (animation->texture (assoc screen :total-time 0) door)
|
||||
:x 160 :y 97 :baseline 99
|
||||
:open door
|
||||
:door-sound (utils/load-sound "door.ogg")
|
||||
:anim-sound-frames {door {1 [:door-sound 0.1]}}
|
||||
)
|
||||
:sword (assoc (utils/get-texture "inside-castle/sword.png")
|
||||
:sword (assoc (utils/atlas->texture atlas "sword")
|
||||
:x 22
|
||||
:y 110
|
||||
:baseline 95)
|
||||
:walkie-talkie (assoc (utils/get-texture "inside-castle/walkie-talkie.png")
|
||||
:walkie-talkie (assoc (utils/atlas->texture atlas "walkie-talkie")
|
||||
:label "Walkie-talkie"
|
||||
:cursor :talk
|
||||
:x 257
|
||||
:y 135
|
||||
:baseline 0
|
||||
:baseline 1
|
||||
:night-profile :sprite
|
||||
:script (actions/get-script entities
|
||||
(actions/talk entities :ego "Let's see if this thing works.")
|
||||
@@ -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
|
||||
@@ -556,12 +570,16 @@
|
||||
(brian-get-to-work entities))
|
||||
(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")
|
||||
:books (assoc (utils/atlas->texture atlas "books")
|
||||
: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
|
||||
:game-player (assoc (utils/atlas->texture atlas "gameplayer") :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
|
||||
|
||||
Reference in New Issue
Block a user