trimmed mobile.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
[play-clj.ui :refer :all]
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]
|
||||
[clojure.pprint]
|
||||
|
||||
[advent.pathfind]
|
||||
[advent.tween :as tween]
|
||||
[advent.zone :as zone]
|
||||
|
||||
@@ -3,13 +3,11 @@
|
||||
[play-clj.ui :refer :all]
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]
|
||||
[clojure.pprint]
|
||||
[clojure.set :as set]
|
||||
[advent.pathfind]
|
||||
[advent.tween :as tween]
|
||||
[advent.utils :as utils]
|
||||
[clojure.core.async :refer [put! <! <!! >! >!! chan go thread take! alts!!]]
|
||||
#_[advent.screens.scene :as scene])
|
||||
[clojure.core.async :refer [put! <! <!! >! >!! chan go thread take! alts!!]])
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
[com.badlogic.gdx.utils.viewport FitViewport]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[play-clj.ui :refer :all]
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]
|
||||
[clojure.pprint]
|
||||
|
||||
[advent.pathfind]
|
||||
[advent.zone :as zone]
|
||||
[advent.utils :as utils])
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]
|
||||
[clojure.tools.logging :as log]
|
||||
[clojure.pprint]
|
||||
|
||||
[advent.pathfind]
|
||||
[advent.actions :as actions]
|
||||
[advent.zone :as zone]
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
{:id id}))
|
||||
entities (into {} (for [[id entity] entities]
|
||||
[id (make-entity id entity)]))]
|
||||
(println "MAKING")
|
||||
(merge params {:collision (advent.pathfind/map-from-resource collision)
|
||||
:interactions interactions-as-list
|
||||
:entities entities})))
|
||||
|
||||
@@ -266,8 +266,8 @@
|
||||
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")}
|
||||
:sounds {#_#_:cat (utils/load-sound "cat-tree/cat.ogg")
|
||||
#_#_:kiss (utils/load-sound "cat-tree/kiss.ogg")}
|
||||
:ladder ladder-entity
|
||||
:blank (rooms/make-entity :blank
|
||||
{:object nil :x 0 :y 0 :width 320 :height 240 :baseline 240
|
||||
|
||||
@@ -225,9 +225,9 @@
|
||||
: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")
|
||||
: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")
|
||||
}
|
||||
:return-portrait (rooms/make-entity :return-portrait {:box [103 70 206 116]
|
||||
:label "Desk"
|
||||
|
||||
@@ -659,7 +659,7 @@
|
||||
:talk game-player-talk-up}
|
||||
:get-to-work game-player-get-to-work
|
||||
:pause-from-work game-player-pause-from-work
|
||||
:flex-sound (utils/load-sound "inside-castle/flex.ogg")
|
||||
#_#_:flex-sound (utils/load-sound "inside-castle/flex.ogg")
|
||||
:anim-sound-frames {game-player-stand-up {11 [:blink 0.3 1.1] }
|
||||
game-player-talk-up {11 [:blink 0.3 1.1]
|
||||
22 [:blink 0.3 1.1]
|
||||
|
||||
@@ -232,8 +232,8 @@
|
||||
(rooms/make :music :inside-antique
|
||||
:name "In jail"
|
||||
:sounds {
|
||||
:squeek (utils/load-sound "inside-jail/squeak.ogg")
|
||||
:crowbar-sound (utils/load-sound "ego/crowbar.ogg")
|
||||
#_#_:squeek (utils/load-sound "inside-jail/squeak.ogg")
|
||||
#_#_:crowbar-sound (utils/load-sound "ego/crowbar.ogg")
|
||||
}
|
||||
:interactions {
|
||||
:lock {:box [172 102 190 124]
|
||||
|
||||
@@ -626,7 +626,7 @@
|
||||
(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")}
|
||||
#_#_:cauldron-sound {:object nil :sound (utils/load-sound "outsidehouse/cauldron.ogg")}
|
||||
:interactions
|
||||
{:door {:box [250 100 281 160]
|
||||
:only-script
|
||||
@@ -774,8 +774,8 @@
|
||||
(actions/talk entities :ego "That's just cruel."))
|
||||
nil)
|
||||
|
||||
:eat-sound (utils/load-sound "outsidehouse/sheep-eat.ogg")
|
||||
:bleet-sound (utils/load-sound "outsidehouse/sheep-bleet.ogg")
|
||||
#_#_:eat-sound (utils/load-sound "outsidehouse/sheep-eat.ogg")
|
||||
#_#_:bleet-sound (utils/load-sound "outsidehouse/sheep-bleet.ogg")
|
||||
:anim-sound-frames {sheep-stand {11 [:eat-sound 0.3]
|
||||
35 [:bleet-sound 0.5]}}
|
||||
:left {:walk (utils/flip sheep-walk)
|
||||
@@ -794,7 +794,7 @@
|
||||
:door (assoc (animation->texture screen door)
|
||||
:x 252 :y 88 :baseline 122
|
||||
:open door
|
||||
:door-sound (utils/load-sound "door.ogg")
|
||||
#_#_:door-sound (utils/load-sound "door.ogg")
|
||||
:anim-sound-frames {door {1 [:door-sound 0.1]}}
|
||||
)
|
||||
:lamb (assoc (utils/get-texture "outsidehouse/lamb.png")
|
||||
|
||||
@@ -196,10 +196,10 @@
|
||||
grow-explode (particle-effect "particles/grow-explode")]
|
||||
(rooms/make :music :fight
|
||||
:name "Duel"
|
||||
:sounds {:shock (utils/load-sound "space/shock.ogg")
|
||||
:shock-short (utils/load-sound "space/shock-short.ogg")
|
||||
:jump (utils/load-sound "space/jump.ogg")
|
||||
:swing-sword (utils/load-sound "space/swingsword.ogg")}
|
||||
:sounds {#_#_:shock (utils/load-sound "space/shock.ogg")
|
||||
#_#_:shock-short (utilw/load-sound "space/shock-short.ogg")
|
||||
#_#_:jump (utils/load-sound "space/jump.ogg")
|
||||
#_#_:swing-sword (utils/load-sound "space/swingsword.ogg")}
|
||||
:interactions
|
||||
{}
|
||||
:layers [(assoc (utils/get-texture "space/background.png") :x 0 :y 0 :baseline 0)]
|
||||
@@ -235,9 +235,9 @@
|
||||
:bloodclot (assoc (animation->texture screen blergh-stand-anim)
|
||||
:x 180 :y 50 :baseline 190
|
||||
:stand blergh-stand-anim
|
||||
:inhale-sound (utils/load-sound "space/bloodclot-inhale.ogg")
|
||||
:exhale-sound (utils/load-sound "space/bloodclot-exhale.ogg")
|
||||
:explode-sound (utils/load-sound "space/bloodclot-explode.ogg")
|
||||
#_#_:inhale-sound (utils/load-sound "space/bloodclot-inhale.ogg")
|
||||
#_#_ :exhale-sound (utils/load-sound "space/bloodclot-exhale.ogg")
|
||||
#_#_ :explode-sound (utils/load-sound "space/bloodclot-explode.ogg")
|
||||
:anim-sound-frames {blergh-stand-anim {0 [:inhale-sound grunt-vol]
|
||||
1 [:exhale-sound grunt-vol]}
|
||||
bloodclot-explode {35 [:grow-sound (constantly 0.5)]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
[play-clj.ui :refer :all]
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]
|
||||
[clojure.pprint]
|
||||
|
||||
[advent.pathfind]
|
||||
[advent.zone :as zone]
|
||||
[advent.utils :as utils])
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
[play-clj.entities :as entities]
|
||||
[play-clj.g2d :refer :all]
|
||||
[clojure.zip :as zip]
|
||||
[clojure.pprint]
|
||||
|
||||
[clojure.java.io :as io]
|
||||
[clojure.tools.logging :as log]
|
||||
[advent.pathfind]
|
||||
@@ -41,7 +41,7 @@
|
||||
[advent.screens.dialogue :refer [talking-screen toast-screen tooltip-screen]]
|
||||
[advent.screens.inventory :refer [inventory-screen]]
|
||||
|
||||
[clojure.core.async :refer [put! <! <!! >! chan go thread take! alts!! poll! dropping-buffer]])
|
||||
[clojure.core.async :refer [put! <! <!! >! chan go thread take! alts!! dropping-buffer]])
|
||||
(:import [com.badlogic.gdx.graphics Pixmap$Format Pixmap Pixmap$Filter Texture Texture$TextureFilter GL20 GL30]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion Animation Batch]
|
||||
[com.badlogic.gdx.math Vector3 Matrix4]
|
||||
@@ -53,8 +53,7 @@
|
||||
[java.lang Object]
|
||||
[com.badlogic.gdx Gdx]
|
||||
[com.badlogic.gdx.graphics Camera Color GL20 OrthographicCamera
|
||||
PerspectiveCamera Pixmap Pixmap$Format PixmapIO Texture
|
||||
VertexAttributes$Usage]
|
||||
PerspectiveCamera Pixmap Pixmap$Format PixmapIO Texture ]
|
||||
[com.badlogic.gdx.scenes.scene2d Actor Stage]))
|
||||
|
||||
#_(set! *unchecked-math* :warn-on-boxed)
|
||||
@@ -655,28 +654,28 @@
|
||||
:origin-x 9
|
||||
:origin-y 0
|
||||
:scaled true
|
||||
:drop-sound (utils/load-sound "ego/drop.ogg")
|
||||
:milk-sound (utils/load-sound "outsidehouse/milk.ogg")
|
||||
:step-sound-1 (utils/load-sound "ego/step-1.ogg")
|
||||
:step-sound-2 (utils/load-sound "ego/step-2.ogg")
|
||||
:step-sound-3 (utils/load-sound "ego/step-3.ogg")
|
||||
:step-sound-4 (utils/load-sound "ego/step-4.ogg")
|
||||
:shoot-sound (utils/load-sound "ego/slingshot.ogg")
|
||||
:glad-sound (utils/load-sound "ego/glad.ogg")
|
||||
#_#_:drop-sound (utils/load-sound "ego/drop.ogg")
|
||||
#_#_:milk-sound (utils/load-sound "outsidehouse/milk.ogg")
|
||||
#_#_:step-sound-1 (utils/load-sound "ego/step-1.ogg")
|
||||
#_#_:step-sound-2 (utils/load-sound "ego/step-2.ogg")
|
||||
#_#_:step-sound-3 (utils/load-sound "ego/step-3.ogg")
|
||||
#_#_:step-sound-4 (utils/load-sound "ego/step-4.ogg")
|
||||
#_#_:shoot-sound (utils/load-sound "ego/slingshot.ogg")
|
||||
#_#_:glad-sound (utils/load-sound "ego/glad.ogg")
|
||||
|
||||
:get-sick-sound (utils/load-sound "ego/get-sick.ogg")
|
||||
:scratch-sound (utils/load-sound "ego/scratch.ogg")
|
||||
:scared-step-sound (utils/load-sound "ego/scared-step.ogg")
|
||||
#_#_:get-sick-sound (utils/load-sound "ego/get-sick.ogg")
|
||||
#_#_:scratch-sound (utils/load-sound "ego/scratch.ogg")
|
||||
#_#_:scared-step-sound (utils/load-sound "ego/scared-step.ogg")
|
||||
|
||||
:inside-step-sound-1 (utils/load-sound "ego/inside-step-1.ogg")
|
||||
:inside-step-sound-2 (utils/load-sound "ego/inside-step-2.ogg")
|
||||
:inside-step-sound-3 (utils/load-sound "ego/inside-step-3.ogg")
|
||||
:inside-step-sound-4 (utils/load-sound "ego/inside-step-4.ogg")
|
||||
:crowbar-sound (utils/load-sound "ego/crowbar.ogg")
|
||||
:sigh-sound (utils/load-sound "ego/sigh.ogg")
|
||||
:axe-sound (utils/load-sound "ego/axe.ogg")
|
||||
:breakglass-sound (utils/load-sound "ego/breakglass.ogg")
|
||||
:idea-sound (utils/load-sound "ego/idea.ogg")
|
||||
#_#_:inside-step-sound-1 (utils/load-sound "ego/inside-step-1.ogg")
|
||||
#_#_:inside-step-sound-2 (utils/load-sound "ego/inside-step-2.ogg")
|
||||
#_#_:inside-step-sound-3 (utils/load-sound "ego/inside-step-3.ogg")
|
||||
#_#_:inside-step-sound-4 (utils/load-sound "ego/inside-step-4.ogg")
|
||||
#_#_:crowbar-sound (utils/load-sound "ego/crowbar.ogg")
|
||||
#_#_:sigh-sound (utils/load-sound "ego/sigh.ogg")
|
||||
#_#_:axe-sound (utils/load-sound "ego/axe.ogg")
|
||||
#_#_:breakglass-sound (utils/load-sound "ego/breakglass.ogg")
|
||||
#_#_:idea-sound (utils/load-sound "ego/idea.ogg")
|
||||
:scale-x start-scale
|
||||
:scale-y start-scale
|
||||
:talk-color (color 0.6 1.0 1.0 1.0)
|
||||
@@ -774,7 +773,7 @@
|
||||
(let [{{:keys [script-running? script-chan]} key} entities]
|
||||
(if script-running?
|
||||
entities
|
||||
(let [next-script (poll! script-chan)]
|
||||
(let [next-script (<! script-chan)]
|
||||
(if next-script
|
||||
(do
|
||||
(next-script entities)
|
||||
@@ -796,7 +795,7 @@
|
||||
(update-in terminated [key] assoc :current nil :started? false)
|
||||
key))
|
||||
(assoc-in entities [key :started?] true)))
|
||||
(let [current (poll! channel)]
|
||||
(let [current (<! channel)]
|
||||
|
||||
(-> entities
|
||||
(assoc-in [key :started?] false)
|
||||
@@ -1089,6 +1088,7 @@
|
||||
has-start-pos? (:x state)
|
||||
|
||||
_ (update! screen :shader shader)
|
||||
log-assets (fn [r] r)
|
||||
rooms {:inside-house (rooms.inside-house/make screen)
|
||||
:inside-stash (rooms.inside-stash/make screen)
|
||||
:outside-house (rooms.outside-house/make screen)
|
||||
@@ -1123,14 +1123,14 @@
|
||||
:inside-antique (utils/make-music "music/inside-antique.ogg")
|
||||
:town-1 (utils/make-music "music/town-music-1.ogg")
|
||||
:town-2 (utils/make-music "music/town-music-2.ogg")
|
||||
:love (utils/make-music "music/love.ogg")
|
||||
:inside-fangald (utils/make-music "music/inside-fangald.ogg")
|
||||
:fight (utils/make-music "music/megaboss.mp3")
|
||||
:pull-sword (utils/make-music "music/pull-sword.ogg")
|
||||
:night (utils/make-music "music/night.ogg")
|
||||
:dream (utils/make-music "dream/music.ogg")
|
||||
:secret-hideout (utils/make-music "music/secret-hideout.ogg")
|
||||
:wind (utils/make-music "music/wind.ogg")}
|
||||
#_#_:love (utils/make-music "music/love.ogg")
|
||||
#_#_:inside-fangald (utils/make-music "music/inside-fangald.ogg")
|
||||
#_#_:fight (utils/make-music "music/megaboss.mp3")
|
||||
#_#_:pull-sword (utils/make-music "music/pull-sword.ogg")
|
||||
#_#_:night (utils/make-music "music/night.ogg")
|
||||
#_#_:dream (utils/make-music "dream/music.ogg")
|
||||
#_#_:secret-hideout (utils/make-music "music/secret-hideout.ogg")
|
||||
#_#_:wind (utils/make-music "music/wind.ogg")}
|
||||
:state state
|
||||
:time-profiles {:object nil
|
||||
:default utils/default-night-merge
|
||||
@@ -1139,10 +1139,10 @@
|
||||
|
||||
:closing? {:object nil
|
||||
:value false}
|
||||
:sounds {:blink (utils/load-sound "ego/blink2.ogg")
|
||||
:pickup (utils/load-sound "pickup.ogg")
|
||||
:disappear (utils/load-sound "inside-house/disappear.ogg")
|
||||
:grow-sound (utils/load-sound "ego/potion.ogg")
|
||||
:sounds {#_#_:blink (utils/load-sound "ego/blink2.ogg")
|
||||
#_#_:pickup (utils/load-sound "pickup.ogg")
|
||||
#_#_:disappear (utils/load-sound "inside-house/disappear.ogg")
|
||||
#_#_:grow-sound (utils/load-sound "ego/potion.ogg")
|
||||
:object nil}
|
||||
:fade {:object nil
|
||||
:opacity 0.0}
|
||||
@@ -1189,6 +1189,8 @@
|
||||
(if has-start-pos?
|
||||
start-pos
|
||||
(:start-pos room))))))}]
|
||||
(log/info "assets so far", (.getDiagnostics *asset-manager*) )
|
||||
|
||||
|
||||
(doseq [[k [start time fn]] (get-in entities [:room :timers])]
|
||||
(add-timer! screen k start time))
|
||||
@@ -1268,7 +1270,7 @@
|
||||
|
||||
:on-render
|
||||
(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)
|
||||
#_(steam/update)
|
||||
(.apply viewport)
|
||||
|
||||
(if (get-in entities [:closing? :value])
|
||||
|
||||
@@ -87,6 +87,10 @@
|
||||
{:can-skip false
|
||||
:do (fn [screen entities]
|
||||
(utils/stop-music (:pop-music entities))
|
||||
|
||||
(log/info "clearing assets" (into [] (.getAssetNames *asset-manager*)) (.getDiagnostics *asset-manager*))
|
||||
(.clear *asset-manager* )
|
||||
(log/info "cleared assets" (into [] (.getAssetNames *asset-manager*)) (.getDiagnostics *asset-manager*))
|
||||
(set-screen! @(resolve 'advent.core/advent) title/title-screen)
|
||||
entities)
|
||||
:duration 0.0}])
|
||||
@@ -102,7 +106,7 @@
|
||||
(graphics! :set-cursor (utils/cursor "cursor.png" :hourglass))
|
||||
|
||||
(let [screen (assoc screen :total-time 0)
|
||||
pop-anim (make-anim-seq "POPPixelLogo_02" [320 240] 0.05 (range 200))
|
||||
#_#_pop-anim (make-anim-seq "POPPixelLogo_02" [320 240] 0.05 (range 200))
|
||||
entities {:background (assoc (utils/get-texture "black.png")
|
||||
:scale-x 80
|
||||
:scale-y 80
|
||||
@@ -110,8 +114,7 @@
|
||||
:origin-x 0
|
||||
:origin-y 0
|
||||
:z 0)
|
||||
:pop-logo (assoc (animation->texture screen pop-anim)
|
||||
:main-anim pop-anim
|
||||
:pop-logo (assoc (utils/get-texture "black.png")
|
||||
:x 0 :y 0
|
||||
:origin-x 0 :origin-y 0
|
||||
:scale-x 4 :scale-y 4
|
||||
@@ -126,11 +129,11 @@
|
||||
|
||||
:on-render
|
||||
(fn [{:keys [^FitViewport viewport] :as screen} entities options]
|
||||
(steam/update)
|
||||
#_(steam/update)
|
||||
(.apply viewport)
|
||||
(clear!)
|
||||
(let [entities (utils/apply-tweens screen entities (:tweens entities))
|
||||
entities (update-in entities [:pop-logo] animate screen)
|
||||
#_#_entities (update-in entities [:pop-logo] animate screen)
|
||||
entities (if (and (:queued-skip? entities) (get-in entities [:current-step :can-skip]))
|
||||
(assoc entities :queued-skip? false :current-step nil)
|
||||
entities)
|
||||
|
||||
@@ -445,7 +445,7 @@
|
||||
|
||||
:on-render
|
||||
(fn [{:keys [^FitViewport viewport] :as screen} entities options]
|
||||
(steam/update)
|
||||
#_(steam/update)
|
||||
(.apply viewport)
|
||||
(clear!)
|
||||
(let [entities (utils/apply-tweens screen entities (:tweens entities))
|
||||
|
||||
Reference in New Issue
Block a user