working on getting everything working again.
This commit is contained in:
@@ -32,9 +32,8 @@
|
||||
(log/log-capture! *ns* :warn :error)
|
||||
(log/info "Starting game on version v" (advent.version/version))
|
||||
(steam/init)
|
||||
(reset! utils/selected-save {:name "Autosave", :id "autosave", :screenshot "saves/screenshot-autosave.png", :state {:y 74.0, :active? true, :coaxed-sheep? true, :seen-bloodclot? true, :seen-frankie? true, :plaques-read #{:sword :shovel}, :knows-about-stash? true, :safe-listen-count 2, :convinced-wizard? true, :time :night, :broke-lock? true, :wool-count 2, :opened-bars? true, :opened-crack? true, :inventory [:flask-water-ash :money :camera :alarm-clock :charcoal :note-1 :flies :spear :crowbar :key :sword :kiss :cat-toy :tune :flask-1-strength :medal :trophy :slingshot], :has-met-gandarf? true, :seen-intro? true, :has-seen-love? true, :has-dropped-coin? true, :wizard-left? false, :dropped-ball? true, :wants-monocle? true, :clues #{:name}, :bubba-gone? false, :hud-active? nil, :allowed-to-keep-teddy? true, :warden-sleeping? true, :current-riddle :done, :owl-tried-strength? true, :opened-blinds? true, :x 239.3914592899382, :warden-fast-asleep? true, :last-room :cat-tree, :wants-toy true, :bent-bars? true, :knows-owl-trouble? true, :chest-contents [], :mints-eaten 0, :object nil, :talked-to-owl? true, :obtained-items #{:balloon :money :flask-2 :tune :flask-1-with-cream-of-mushroom :key :flask-water-ash :slingshot :teddy :flies :recipe :mushrooms :rope :flask-1-with-milk :kiss :wool :portrait :slobber :spear :medal :sword :frog-legs :flask-1 :flask-1-strength :dream-sword :mandrake :walkie-talkies :shovel :ash :cat-toy :grass :camera :sack-lunch :stick :charcoal :ladder :carrot :trophy :monocle :alarm-clock :crowbar :note-1 :flask-1-slobber :glass-eye :flask-water :ball-n-chain}}, :blurb "Autosave"})
|
||||
(set-screen! @(resolve 'advent.core/advent) scene/scene #_scene/demo scene/hud dialogue/talking-screen dialogue/choice-screen dialogue/toast-screen inventory/inventory-screen safe/safe-screen fade/fade-screen
|
||||
)))
|
||||
|
||||
(set-screen! @(resolve 'advent.core/advent) splash/splash-screen)))
|
||||
|
||||
(defn reload []
|
||||
(on-gl (set-screen! advent title/title-screen)))
|
||||
|
||||
@@ -1121,7 +1121,7 @@ void main ()
|
||||
(log/info "Initializing scene.")
|
||||
|
||||
(let [screen (assoc screen :total-time 0)]
|
||||
(let [[^OrthographicCamera cam] (utils/setup-viewport screen 320 240)]
|
||||
(let [{cam :camera} (utils/setup-viewport screen 320 240)]
|
||||
(set! (. cam zoom) 0.95)
|
||||
(let [shader (ShaderProgram. ^String v-shader ^String pix-shader)
|
||||
_ (log/info "shader log:" (.getLog shader))
|
||||
@@ -1793,7 +1793,7 @@ void main ()
|
||||
:on-render
|
||||
(fn [{:keys [^FitViewport viewport] :as screen} entities options]
|
||||
(.apply viewport)
|
||||
#_(let [entities (utils/apply-tweens screen entities (:tweens entities))
|
||||
(let [entities (utils/apply-tweens screen entities (:tweens entities))
|
||||
entities (update-in entities [:inventory] animate screen )
|
||||
hud-interactable? (hud-interactable?)
|
||||
entities (if hud-interactable?
|
||||
|
||||
@@ -209,7 +209,7 @@
|
||||
:z 8
|
||||
:opacity 1.0)))
|
||||
|
||||
(defn main-menu []
|
||||
(defn main-menu [screen]
|
||||
(let [start-playing-label (quest-label)
|
||||
is-starting? (= "Begin Quest" start-playing-label)]
|
||||
(make-table [[(make-button start-playing-label :key :continue-or-start) :height 56 :pad-bottom 4 :width 250]
|
||||
@@ -338,77 +338,80 @@
|
||||
(defscreen title-screen
|
||||
:on-show
|
||||
(fn [screen entities options]
|
||||
(utils/setup-viewport screen 1280 960)
|
||||
(log/info "Starting title screen.")
|
||||
|
||||
(let [font (utils/get-font "ego/font.fnt")
|
||||
music (utils/make-music "music/intro.ogg")
|
||||
balloon (utils/make-anim "title/balloon.png" [15 30] 0.45 (range 4))
|
||||
banner-back (utils/make-anim "title/banner-back.png" [180 42] 0.2 [0 1 2 1 0 1 2 1])]
|
||||
(let [screen (utils/setup-viewport screen 1280 960)]
|
||||
(log/info "Starting title screen.")
|
||||
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :hourglass))
|
||||
|
||||
(let [entities {:background (assoc (utils/get-texture "title/background.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 0)
|
||||
:cloud-background (assoc (utils/get-texture "title/clouds.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 2)
|
||||
:banner-back (assoc (animation->texture (assoc screen :total-time 0.0) banner-back) :x 580 :y 400 :scale-x 4 :scale-y 4
|
||||
:anim banner-back
|
||||
:z 3)
|
||||
:quill (doto (assoc (image-button (BaseDrawable.)) :x 1150 :y 4 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 10 :key :quill)
|
||||
|
||||
(image-button! :add (doto (Group. )
|
||||
(.addActor (:object (doto (image (utils/get-texture "title/quill.png"))
|
||||
(image! :set-scale 4))))))
|
||||
|
||||
save-object)
|
||||
:logo (assoc (utils/get-texture "title/logo.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 6)
|
||||
:fade (assoc (utils/get-texture "black.png")
|
||||
:scale-x 80
|
||||
:scale-y 80
|
||||
:opacity 1.0
|
||||
:origin-x 0
|
||||
:origin-y 0
|
||||
:z 100)
|
||||
:flying-ego (assoc (utils/get-texture "ego/flying.png")
|
||||
:left (flip (utils/get-texture "ego/flying.png"))
|
||||
:right (utils/get-texture "ego/flying.png")
|
||||
:scale-x 5
|
||||
:scale-y 5
|
||||
:origin-x 2
|
||||
:origin-y 0
|
||||
:path (catmull-rom-spline (map #(apply vector-2* %) [[-800 450] [1280 450] [2000 100] [0 100] [-800 300] [1280 300] [2000 450]]) true)
|
||||
:x 450
|
||||
:y 650
|
||||
:z 5)
|
||||
:balloon (assoc (animation->texture (assoc screen :total-time 0.0) balloon) :x 100 :y 100 :scale-x 4 :scale-y 4
|
||||
:anim balloon
|
||||
:path (catmull-rom-spline (map #(apply vector-2* %)
|
||||
[[50 50] [70 100] [100 200] [151 206] [300 225]
|
||||
[480 300] [560 400] [650 440] [700 550] [750 600]
|
||||
[860 650] [950 700] [1030 800] [1280 960] [1300 1000]
|
||||
[-50 1000] [-50 -50]]) true)
|
||||
:z 3)
|
||||
:particle-clouds (assoc (particle-effect "particles/particle-clouds" :reset :start) :x 640 :y 480 :z 1)
|
||||
:ego-jet (assoc (particle-effect "particles/jet" :reset :start) :x 450 :y 650 :z 4)
|
||||
(let [font (utils/get-font "ego/font.fnt")
|
||||
music (utils/make-music "music/intro.ogg")
|
||||
balloon (utils/make-anim "title/balloon.png" [15 30] 0.45 (range 4))
|
||||
banner-back (utils/make-anim "title/banner-back.png" [180 42] 0.2 [0 1 2 1 0 1 2 1])]
|
||||
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :hourglass))
|
||||
|
||||
(let [entities {:background (assoc (utils/get-texture "title/background.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 0)
|
||||
:cloud-background (assoc (utils/get-texture "title/clouds.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 2)
|
||||
:banner-back (assoc (animation->texture (assoc screen :total-time 0.0) banner-back) :x 580 :y 400 :scale-x 4 :scale-y 4
|
||||
:anim banner-back
|
||||
:z 3)
|
||||
:quill (doto (assoc (image-button (BaseDrawable.)) :x 1150 :y 4 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 10 :key :quill)
|
||||
|
||||
(image-button! :add (doto (Group. )
|
||||
(.addActor (:object (doto (image (utils/get-texture "title/quill.png"))
|
||||
(image! :set-scale 4))))))
|
||||
|
||||
save-object
|
||||
(#(utils/add-actor-to-stage screen %)))
|
||||
:logo (assoc (utils/get-texture "title/logo.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 6)
|
||||
:fade (assoc (utils/get-texture "black.png")
|
||||
:scale-x 80
|
||||
:scale-y 80
|
||||
:opacity 1.0
|
||||
:origin-x 0
|
||||
:origin-y 0
|
||||
:z 100)
|
||||
:flying-ego (assoc (utils/get-texture "ego/flying.png")
|
||||
:left (flip (utils/get-texture "ego/flying.png"))
|
||||
:right (utils/get-texture "ego/flying.png")
|
||||
:scale-x 5
|
||||
:scale-y 5
|
||||
:origin-x 2
|
||||
:origin-y 0
|
||||
:path (catmull-rom-spline (map #(apply vector-2* %) [[-800 450] [1280 450] [2000 100] [0 100] [-800 300] [1280 300] [2000 450]]) true)
|
||||
:x 450
|
||||
:y 650
|
||||
:z 5)
|
||||
:balloon (assoc (animation->texture (assoc screen :total-time 0.0) balloon) :x 100 :y 100 :scale-x 4 :scale-y 4
|
||||
:anim balloon
|
||||
:path (catmull-rom-spline (map #(apply vector-2* %)
|
||||
[[50 50] [70 100] [100 200] [151 206] [300 225]
|
||||
[480 300] [560 400] [650 440] [700 550] [750 600]
|
||||
[860 650] [950 700] [1030 800] [1280 960] [1300 1000]
|
||||
[-50 1000] [-50 -50]]) true)
|
||||
:z 3)
|
||||
:particle-clouds (assoc (particle-effect "particles/particle-clouds" :reset :start) :x 640 :y 480 :z 1)
|
||||
:ego-jet (assoc (particle-effect "particles/jet" :reset :start) :x 450 :y 650 :z 4)
|
||||
|
||||
#_#_:toolbox (-> (assoc (nine-patch {:region (:object (utils/get-texture "talk-bg-2.png")) :left 9 :top 9 :right 9 :bottom 9})
|
||||
:y 58 :width 500 :height 297
|
||||
:z 7)
|
||||
center)
|
||||
:main-menu (main-menu)
|
||||
:saves-list (utils/snapshot-screenshots)
|
||||
:save-index 0
|
||||
:font font
|
||||
:music music
|
||||
:volume 1.0
|
||||
:copyright (make-label (str "© Digital Bounce House 2016 - v" (advent.version/version)) label-color)
|
||||
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0
|
||||
:finish #(do
|
||||
#_#_:toolbox (-> (assoc (nine-patch {:region (:object (utils/get-texture "talk-bg-2.png")) :left 9 :top 9 :right 9 :bottom 9})
|
||||
:y 58 :width 500 :height 297
|
||||
:z 7)
|
||||
center)
|
||||
:main-menu (->> (main-menu screen)
|
||||
(utils/add-actor-to-stage screen))
|
||||
:saves-list (utils/snapshot-screenshots)
|
||||
:save-index 0
|
||||
:font font
|
||||
:music music
|
||||
:volume 1.0
|
||||
:copyright (->> (make-label (str "© Digital Bounce House 2016 - v" (advent.version/version)) label-color)
|
||||
(utils/add-actor-to-stage screen))
|
||||
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0
|
||||
:finish #(do
|
||||
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :main))
|
||||
(utils/play-music (:music %)) %)
|
||||
:ease tween/ease-in-quadratic)}}
|
||||
]
|
||||
(merge entities (:main-menu entities)))))
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :main))
|
||||
(utils/play-music (:music %)) %)
|
||||
:ease tween/ease-in-quadratic)}}
|
||||
]
|
||||
(merge entities (:main-menu entities))))))
|
||||
|
||||
|
||||
:on-render
|
||||
@@ -478,7 +481,7 @@
|
||||
(dissoc :save-menu)
|
||||
(dissoc :chapters-menu)
|
||||
(dissoc :settings-menu)
|
||||
(assoc :main-menu (main-menu)))
|
||||
(assoc :main-menu (main-menu screen)))
|
||||
|
||||
(#{:dont-delete-button } actor-key)
|
||||
(as-> entities entities
|
||||
|
||||
@@ -23,6 +23,12 @@
|
||||
InputMultiplexer InputProcessor Net Preferences Screen]
|
||||
[java.lang Object]))
|
||||
|
||||
(defn add-actor-to-stage [{:keys [^Stage renderer ui-listeners]} {:keys [^Actor object] :as entity}]
|
||||
(.addActor renderer object)
|
||||
(doseq [[_ listener] ui-listeners]
|
||||
(.addListener ^Actor object listener))
|
||||
entity)
|
||||
|
||||
(defn log-coords [screen entities]
|
||||
(let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})]
|
||||
(log/info (:input-x screen) (:input-y screen) "->" x y)))
|
||||
@@ -334,7 +340,7 @@
|
||||
stage (Stage. viewport)]
|
||||
(update! screen :renderer stage :viewport viewport :camera cam)
|
||||
(.apply viewport)
|
||||
[cam viewport stage]))
|
||||
(assoc screen :renderer stage :viewport viewport :camera cam)))
|
||||
|
||||
(defn unproject
|
||||
([screen options]
|
||||
|
||||
Reference in New Issue
Block a user