This commit is contained in:
Bryce Covert
2015-11-04 21:43:47 -08:00
parent 4c1e91a6fb
commit 66b446c16c
18 changed files with 27 additions and 7 deletions

View File

@@ -15,6 +15,7 @@
(defn make [screen]
(rooms/make :music {:day :town-2 :night :night}
:name "Behind house"
:interactions
{:left-dir {:box [0 131 154 224]
:script (actions/get-script

View File

@@ -243,6 +243,7 @@
walkie-visible (animation 1.0 [(utils/get-texture "castle-gate/throw-walkie-9.png")])
walkie-invisible (animation 1.0 [(utils/get-texture "castle-gate/throw-walkie-1.png")])]
(rooms/make :music {:day :town-2 :night :night}
:name "Castle gate"
:timers {:taunt [1.0 6.0 flip-coin]}
:interactions {:right-dir {:box [280 40 320 83]
:script (actions/get-script entities

View File

@@ -230,6 +230,7 @@
owl-puke (utils/make-anim "cat-tree/owl.png" [21 30] 0.10 [0 0 2 2 3 2 2 3 3 2 3 3 3 4 5 6 7 4 4 3 3 2 2 2 2 2])
puke (particle-effect "particles/puke")]
(rooms/make :music {:day :town-2 :night :night}
:name "Tree"
:sounds {:cat (utils/load-sound "cat-tree/cat.ogg")
:kiss (utils/load-sound "cat-tree/kiss.ogg")}
:ladder ladder-entity

View File

@@ -351,6 +351,7 @@
fairy-godfather-talk-anim (utils/make-anim "dream/fairy-godfather.png" [63 77] 0.15 [5 6 7 8 7 6])
fairy-godfather-magic-anim (utils/make-anim "dream/fairy-godfather-magic.png" [100 77] 0.15 [0 1 2 3 4 4 4 4 3 2 1 0])]
(rooms/make :music {:intro :wind :day :dream}
:name "Dream"
:interactions {:pit {:box [54 0 219 36]
:script (actions/get-script entities
(actions/walk-to entities :ego [154 41])

View File

@@ -36,6 +36,7 @@
duke-knight (utils/make-anim "ending-castle/duke.png" [40 48] 0.23 [8 9 10 9 8])
scaler (utils/scaler-fn-with-baseline 20 0.01 1.20)]
(rooms/make :music :dream
:name "Ending"
:interactions {}
:layers [(assoc (utils/get-texture "ending-castle/ending-castle2-assets/background.png") :x 0 :y 0 :origin-x 0 :origin-y 0 :baseline 0)
(assoc (utils/get-texture "ending-castle/ending-castle2-assets/foreground.png") :x 160 :y 0 :origin-x 165 :origin-y 5 :baseline 240 :parallax 1.4)]

View File

@@ -60,6 +60,7 @@
(let [bloodclot-talk (utils/make-anim-seq "held/bloodclot-head" [114 82] 0.1 [0 1 2 1 0 3 3 0 1 2 1 0 3 4 5 6 5 3 3 1 2 1 3 3 3 3 3 0 0 0 7 8 7])
bloodclot-stand (utils/make-anim-seq "held/bloodclot-head" [114 82] 0.1 (flatten [(repeat 15 0) 7 8 7]))]
(rooms/make :music :fight
:name "Held"
:interactions {:bloodclot {:box [182 42 270 196]
:script (actions/get-script entities
(bloodclot-talk-script entities))

View File

@@ -187,6 +187,7 @@
:shopkeep "That teddy bear does not leave my store."
:shopkeep "My son would be stricken with grief to find it missing."))))]
(rooms/make :music :inside-antique
:name "Antique shop"
:sounds {:fire-1 (utils/load-sound "inside-antique/fire-1.ogg")
:fire-2 (utils/load-sound "inside-antique/fire-2.ogg")
:fire-3 (utils/load-sound "inside-antique/fire-3.ogg")

View File

@@ -185,6 +185,7 @@
[1 1 1 1 1 0 1 0 1 2 2 1 1 2 2 1 1 2 2 2 1 1 0 1 1 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3])))
hands-fight-lose (utils/make-anim "inside-cafeteria/hands-fight.png" [104 104] 0.075 (flatten [4 4 4 4 4 4 0 0 0 0 4 4 4 0 0 0 5 5 5 6 6 6 6 6 6]))]
(rooms/make :music :town-1
:name "Cafeteria"
:interactions
{:right-dir {:box [272 45 320 120]
:script (actions/get-script

View File

@@ -361,6 +361,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}
:name "Inside castle"
:timers {:brian [10.0 20.0 brian]}
:interactions
{:right-door {:box [286 140 306 160]

View File

@@ -136,6 +136,7 @@
candle-aura (utils/make-anim "inside-house/candle-aura.png" [27 27] 0.2 [0 1 2 3 2 1] )
experiment-left (utils/flip (utils/make-anim-seq "wizard/experiment" [45 55] 0.075 [0 0 0 0 0 0 0 0 0 0 1 1 2 2 2 2 3 3 3 4 4 5 5 6 6 6 6 6 6 7 8 9 9 10 10 11 11 12 12 12 12 12 12 12 12 12 12 12 13 13 14 14 14 14 14 15 15 16 16 17 17 18 18 18 18 19 20 21 21 21 21 21 21 22 23 22 23 22 23 22 23 23 23 23 23 23 23 23 24 24 24 24 24 24 24 24 24 25 26 27 37 38 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 29 29 29 28 28 28 28 29 29 28 28 28 28 28 28 28 28 30 30 30 30 31 32 33 31 31 31 31 31 31 31 31 34 35 36 36 36 36 36 36 36 36 36] ))]
(rooms/make :music :inside-fangald
:name "Inside house"
:interactions {:down-dir {:box [151 0 320 40]
:script (actions/get-script entities
(actions/update-state entities #(assoc % :wizard-left? false))

View File

@@ -52,6 +52,7 @@
candle-aura (utils/make-anim "inside-house/candle-aura.png" [27 27] 0.2 [0 1 2 3 2 1] )
]
(rooms/make :music {:day :secret-hideout :night :secret-hideout}
:name "Inside stash"
:interactions
{:left-dir {:box [91 60 125 140]
:script (actions/get-script

View File

@@ -289,6 +289,7 @@
(aget steer-sheet 0 i)))
flies-stand (utils/make-anim "outside-castle/flies.png" [15 15] 0.075 (flatten (repeat 2 [0 1 2 1])))]
(rooms/make :music {:day :town-2 :night :night :sunrise :night}
:name "Outside castle"
:interactions
{:right-dir {:box [280 40 320 140]
:script (actions/get-script

View File

@@ -601,6 +601,7 @@
lamb-walk (animation 0.075 (for [i (range 4)]
(aget lamb-walk-sheet 0 i)))]
(rooms/make :music {:day :town-2 :night :night}
:name "Outside house"
:update-fn jump-around
:cauldron-sound {:object nil :sound (utils/load-sound "outsidehouse/cauldron.ogg")}
:interactions

View File

@@ -103,6 +103,7 @@
candle-flame (utils/make-anim "outside-jail/candle.png" [20 25] 0.075 (range 4))
candle-aura (utils/make-anim "outside-jail/candle-aura2.png" [135 135] 0.3 [0 1 2 1] )]
(rooms/make :music {:day :town-1 :night :night}
:name "Fountain"
:interactions {:down-dir {:box [30 0 227 40]
:script (actions/get-script entities
(actions/walk-to entities :ego [159 5] :skip-type :end :stop? false)

View File

@@ -193,6 +193,7 @@
lightning-effect (particle-effect "particles/lightning")
grow-explode (particle-effect "particles/grow-explode")]
(rooms/make :music :fight
:name "Duel"
:sounds {:shock (utils/load-sound "space/shock.ogg")
:jump (utils/load-sound "space/jump.ogg")
:swing-sword (utils/load-sound "space/swingsword.ogg")}

View File

@@ -1247,7 +1247,11 @@ void main ()
(click-inventory screen entities))
:on-save (fn [screen [entities]]
(when-not (get-in entities [:actions :script-running?])
(utils/save entities (str (java.util.UUID/randomUUID)) (str "Save " (rand-int 20)))))
(let [date (.format (java.text.SimpleDateFormat. "MM/dd/YY") (java.util.Date.))]
(utils/save entities
(str (java.util.UUID/randomUUID))
(str (-> entities :room :name) " - " date)
date))))
:on-menu (fn [{:keys [viewport] :as screen} [entities]]
(when-not (or (get-in entities [:tweens :fade-out])
@@ -1328,13 +1332,13 @@ void main ()
:inventory (assoc (utils/get-texture "inventory.png") :x 278 :y 0 :baseline 9000
:mouse-in? (zone/box 278 0 320 42)
:opacity 0.8)
:fps (assoc (label "" (color :white) ) :x 5 :baseline 0 :opacity 0.1)}))
#_#_:fps (assoc (label "" (color :white) ) :x 5 :baseline 0 :opacity 0.1)}))
:on-render
(fn [{:keys [^FitViewport viewport] :as screen} [entities]]
(.apply viewport)
(let [entities (utils/apply-tweens screen entities (:tweens entities))]
(label! (:fps entities) :set-text (str (game :fps)))
#_(label! (:fps entities) :set-text (str (game :fps)))
(render! screen [ (:save entities) (:inventory entities) (:close entities)])
entities))

View File

@@ -229,7 +229,7 @@
(.setUncheckLast true))
[cell-w cell-h] [218 161]
make-cell (fn [image] [image :width cell-w :pad 4 4 4 4 :height cell-h])
make-save-screenshot (fn [{:keys [screenshot name id state] :as save}]
make-save-screenshot (fn [{:keys [screenshot name id state blurb] :as save}]
(let [btn (doto (assoc (image-button (skin "ui/ui.json"))
:save save
:name name)
@@ -239,7 +239,7 @@
(.setOrigin (/ (- cell-w 16) 2) (/ (- cell-h 16) 2))
(.addActor (:object (doto (image (texture screenshot))
(image! :set-size (- cell-w 16) (- cell-h 16)))))
(.addActor (:object (make-label (str " " (subs name 0 (min (.length name) 10))))))
(.addActor (:object (make-label (str " " (or blurb name)))))
))
save-object)]

View File

@@ -93,7 +93,7 @@
(edn/read-string (.getString prefs "chapters"))
saves/chapters)))
(defn save [entities id name]
(defn save [entities id name & [blurb]]
(let [prefs (.getPreferences (Gdx/app) "ticks-tales-saves")
saves (if (.contains prefs "saves")
(edn/read-string (.getString prefs "saves"))
@@ -101,7 +101,8 @@
saves (cons {:name name
:id id
:screenshot (save-screenshot-file-name id)
:state (entities :state)}
:state (entities :state)
:blurb (or blurb name)}
(filter (comp (complement #{id}) :id) saves))]
(.putString prefs "saves" (pr-str saves))
(.flush prefs)