diff --git a/desktop/resources/outsidehouse/background.png b/desktop/resources/outsidehouse/background.png index fb839dff..11da2d7d 100644 Binary files a/desktop/resources/outsidehouse/background.png and b/desktop/resources/outsidehouse/background.png differ diff --git a/desktop/resources/outsidehouse/fg1.png b/desktop/resources/outsidehouse/fg1.png new file mode 100644 index 00000000..5e950845 Binary files /dev/null and b/desktop/resources/outsidehouse/fg1.png differ diff --git a/desktop/resources/outsidehouse/fg2.png b/desktop/resources/outsidehouse/fg2.png new file mode 100644 index 00000000..96bd7483 Binary files /dev/null and b/desktop/resources/outsidehouse/fg2.png differ diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index 01671781..cb3d2b5b 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -35,12 +35,16 @@ [advent.screens.inventory :refer [inventory-screen]] [clojure.core.async :refer [put! ! chan go thread take! alts!!]]) (:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter GL20 GL30] - [com.badlogic.gdx.graphics.g2d TextureRegion Animation] + [com.badlogic.gdx.graphics.g2d TextureRegion Animation Batch] [com.badlogic.gdx.math Vector3 Matrix4] [com.badlogic.gdx.utils.viewport FitViewport] [com.badlogic.gdx.scenes.scene2d Actor Stage] [java.lang Object] - [com.badlogic.gdx Gdx])) + [com.badlogic.gdx Gdx] + [com.badlogic.gdx.graphics Camera Color GL20 OrthographicCamera + PerspectiveCamera Pixmap Pixmap$Format PixmapIO Texture + VertexAttributes$Usage] + [com.badlogic.gdx.scenes.scene2d Actor Stage])) (declare hud) @@ -432,25 +436,28 @@ (update-fn screen entities) entities)) -(defn render-foreground [{:keys [camera renderer] :as screen} foreground] +(defn render-foreground [{:keys [^OrthographicCamera camera ^Stage renderer] :as screen} foreground] + #_(println camera) (let [tmp (Vector3.) tmp2 (Vector3.) parallax-view (Matrix4.) parallax-combined (Matrix4.)] (.update camera) (.set tmp (.position camera)) - (set! (.x tmp) (* (.x tmp) 2)) - (set! (.y tmp) (* (.y tmp) 2)) + (set! (.x tmp) (* (.x tmp) 1.5)) + (set! (.y tmp) (* (.y tmp) 1.5)) (.setToLookAt parallax-view tmp (-> tmp2 (.set tmp) - (.add (.direction camera)) - ( .up camera))) + (.add (.direction camera))) + (.up camera)) (.set parallax-combined (.projection camera)) (Matrix4/mul (.val parallax-combined) (.val parallax-view)) - (.setProjectionMatrix camera parallax-combined) - (let [batch (.getBatch renderer)] + + (let [^Batch batch (.getBatch renderer)] + (.begin batch) - (draw! (:tex foreground) screen batch) + (.setProjectionMatrix batch parallax-combined) + (entities/draw! (:tex foreground) screen batch) (.end batch)))) @@ -520,7 +527,7 @@ :override nil :last-pos [0 0]} :foreground {:object nil - :tex (assoc (texture "outsidehouse/foreground.png") :x 0 :y 0 :baseline 1000)} + :tex (assoc (texture "outsidehouse/fg1.png") :x 75 :y 57 :baseline 1000)} :all-items (assoc items/items :object nil) :started? {:value false