more perf enhancements, getting ready for multi save slots.
This commit is contained in:
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
:assets-paths ["/Users/brycecovert/dev/advent/desktop/resources"]
|
:assets-paths ["/Users/brycecovert/dev/advent/desktop/resources"]
|
||||||
:native-libraries-paths ["libs"]
|
:native-libraries-paths ["libs"]
|
||||||
:target-version "15"
|
:target-version "15" ; 18+
|
||||||
:aot-exclude-ns ["clojure.parallel" "clojure.core.reducers"
|
:aot-exclude-ns ["clojure.parallel" "clojure.core.reducers"
|
||||||
"cider.nrepl" "cider-nrepl.plugin"
|
"cider.nrepl" "cider-nrepl.plugin"
|
||||||
"cider.nrepl.middleware.util.java.parser"
|
"cider.nrepl.middleware.util.java.parser"
|
||||||
|
|||||||
@@ -3,15 +3,7 @@
|
|||||||
|
|
||||||
:dependencies [[com.badlogicgames.gdx/gdx "1.5.3"]
|
:dependencies [[com.badlogicgames.gdx/gdx "1.5.3"]
|
||||||
[com.badlogicgames.gdx/gdx-backend-lwjgl "1.5.3"]
|
[com.badlogicgames.gdx/gdx-backend-lwjgl "1.5.3"]
|
||||||
[com.badlogicgames.gdx/gdx-box2d "1.5.3"]
|
[com.badlogicgames.gdx/gdx-platform "1.5.3" :classifier "natives-desktop"]
|
||||||
[com.badlogicgames.gdx/gdx-tools "1.5.3"]
|
|
||||||
[com.badlogicgames.gdx/gdx-box2d-platform "1.5.3"
|
|
||||||
:classifier "natives-desktop"]
|
|
||||||
[com.badlogicgames.gdx/gdx-bullet "1.5.3"]
|
|
||||||
[com.badlogicgames.gdx/gdx-bullet-platform "1.5.3"
|
|
||||||
:classifier "natives-desktop"]
|
|
||||||
[com.badlogicgames.gdx/gdx-platform "1.5.3"
|
|
||||||
:classifier "natives-desktop"]
|
|
||||||
[org.clojure/clojure "1.6.0"]
|
[org.clojure/clojure "1.6.0"]
|
||||||
[org.clojure/tools.nrepl "0.2.7"]
|
[org.clojure/tools.nrepl "0.2.7"]
|
||||||
[play-clj "0.4.5-BRYCE"]
|
[play-clj "0.4.5-BRYCE"]
|
||||||
@@ -23,6 +15,7 @@
|
|||||||
:aliases {"pack" ["run" "-m" "com.badlogic.gdx.tools.texturepacker.TexturePacker" "asset-work/" "resources/packed/"]}
|
:aliases {"pack" ["run" "-m" "com.badlogic.gdx.tools.texturepacker.TexturePacker" "asset-work/" "resources/packed/"]}
|
||||||
:profiles {
|
:profiles {
|
||||||
:dev {
|
:dev {
|
||||||
|
:dependencies [[com.badlogicgames.gdx/gdx-tools "1.5.3"]]
|
||||||
:warn-on-reflection true}
|
:warn-on-reflection true}
|
||||||
}
|
}
|
||||||
:aot [advent.core.desktop-launcher]
|
:aot [advent.core.desktop-launcher]
|
||||||
|
|||||||
@@ -337,7 +337,8 @@
|
|||||||
:ego "What's this?")
|
:ego "What's this?")
|
||||||
(actions/give entities :kiss)
|
(actions/give entities :kiss)
|
||||||
(actions/do-dialogue entities :ego "A kiss for an inventory item?"
|
(actions/do-dialogue entities :ego "A kiss for an inventory item?"
|
||||||
:ego "Sounds like the game designer was running out of good ideas."))
|
:ego "Sounds like the game designer was running out of good ideas.")
|
||||||
|
(utils/snapshot-state @entities "The Cat Whisperer"))
|
||||||
(actions/talk entities :ego "I guess I'm too far away.")))
|
(actions/talk entities :ego "I guess I'm too far away.")))
|
||||||
:default (actions/get-script entities (actions/talk entities :ego "Kitty seems disinterested in it."))})
|
:default (actions/get-script entities (actions/talk entities :ego "Kitty seems disinterested in it."))})
|
||||||
cat-stand)
|
cat-stand)
|
||||||
|
|||||||
@@ -240,6 +240,7 @@
|
|||||||
:fairy-godfather "Choose the broom or shovel, and cast it into the pit of fate."
|
:fairy-godfather "Choose the broom or shovel, and cast it into the pit of fate."
|
||||||
:ego "But..."
|
:ego "But..."
|
||||||
:fairy-godfather "No buts.")
|
:fairy-godfather "No buts.")
|
||||||
|
(utils/snapshot-state @entities "Our tale's beginning")
|
||||||
(actions/update-state entities #(assoc % :seen-intro? true)))
|
(actions/update-state entities #(assoc % :seen-intro? true)))
|
||||||
|
|
||||||
(defn swing [entities]
|
(defn swing [entities]
|
||||||
|
|||||||
@@ -80,7 +80,8 @@
|
|||||||
:warriors "Congratulations young master. Thou art worthy in might."
|
:warriors "Congratulations young master. Thou art worthy in might."
|
||||||
:warriors "Take thy servant's medal of strength.")
|
:warriors "Take thy servant's medal of strength.")
|
||||||
(actions/give entities :medal)
|
(actions/give entities :medal)
|
||||||
(actions/glad entities))
|
(actions/glad entities)
|
||||||
|
(utils/snapshot-state @entities "Pro (arm) Wrestler"))
|
||||||
(do
|
(do
|
||||||
(play-battle entities :lose)
|
(play-battle entities :lose)
|
||||||
(actions/do-dialogue entities
|
(actions/do-dialogue entities
|
||||||
|
|||||||
@@ -575,7 +575,8 @@
|
|||||||
(actions/give entities :trophy)
|
(actions/give entities :trophy)
|
||||||
(actions/remove-entity entities :trophy)
|
(actions/remove-entity entities :trophy)
|
||||||
(actions/glad entities)
|
(actions/glad entities)
|
||||||
(actions/talk entities :ego "Thanks!"))
|
(actions/talk entities :ego "Thanks!")
|
||||||
|
(utils/snapshot-state @entities "The Wise Guy"))
|
||||||
(actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking."))
|
(actions/do-dialogue entities :ego "What about this?" :game-player "No, that's not the solution. Keep looking."))
|
||||||
(brian-get-to-work entities))
|
(brian-get-to-work entities))
|
||||||
:trophy (actions/get-script entities
|
:trophy (actions/get-script entities
|
||||||
|
|||||||
@@ -191,10 +191,12 @@
|
|||||||
(actions/talk entities :ego "I probably shouldn't leave without my belongings.")
|
(actions/talk entities :ego "I probably shouldn't leave without my belongings.")
|
||||||
(do (actions/transition-background entities :outside-jail [50 46] :face :right)
|
(do (actions/transition-background entities :outside-jail [50 46] :face :right)
|
||||||
(if (get-in @entities [:state :dropped-ball?])
|
(if (get-in @entities [:state :dropped-ball?])
|
||||||
(actions/do-dialogue entities :ego "Yes I made it!"
|
(do
|
||||||
:ego "But what now?"
|
(actions/do-dialogue entities :ego "Yes I made it!"
|
||||||
:ego "I have till sunrise before Bloodclot comes and destroys the town."
|
:ego "But what now?"
|
||||||
:ego "Maybe Gandarf can help me!")
|
:ego "I have till sunrise before Bloodclot comes and destroys the town."
|
||||||
|
:ego "Maybe Gandarf can help me!")
|
||||||
|
(utils/snapshot-state @entities "Prisoner On The Loose"))
|
||||||
(do
|
(do
|
||||||
(actions/do-dialogue entities :ego "Yes I made it!"
|
(actions/do-dialogue entities :ego "Yes I made it!"
|
||||||
:guard "Hmm?"
|
:guard "Hmm?"
|
||||||
|
|||||||
@@ -269,7 +269,8 @@
|
|||||||
:bloodclot-head "Starting with his precious Georgia McGorgeous.")
|
:bloodclot-head "Starting with his precious Georgia McGorgeous.")
|
||||||
(bloodclot-disappear entities)
|
(bloodclot-disappear entities)
|
||||||
(common/go-to-jail entities 5.0)
|
(common/go-to-jail entities 5.0)
|
||||||
(actions/do-dialogue entities :ego "Hey!" :ego "What's going on? I was just about to teach Bloodclot a lesson!"))))
|
(actions/do-dialogue entities :ego "Hey!" :ego "What's going on? I was just about to teach Bloodclot a lesson!")
|
||||||
|
(utils/snapshot-state @entities "In The Slammer"))))
|
||||||
:magic-slingshot (actions/get-script entities
|
:magic-slingshot (actions/get-script entities
|
||||||
(actions/do-dialogue entities
|
(actions/do-dialogue entities
|
||||||
:ego "Hey Bloodclot!"
|
:ego "Hey Bloodclot!"
|
||||||
|
|||||||
@@ -55,21 +55,29 @@
|
|||||||
atlas (texture-atlas "packed/pack.atlas")]
|
atlas (texture-atlas "packed/pack.atlas")]
|
||||||
(texture (texture-atlas! atlas :find-region atlas-name))))
|
(texture (texture-atlas! atlas :find-region atlas-name))))
|
||||||
|
|
||||||
(defn save [entities]
|
(defn snapshot-state [entities name]
|
||||||
(doto (.getPreferences (Gdx/app) "ticks-tales-saves")
|
(doto (.getPreferences (Gdx/app) "ticks-tales-saves")
|
||||||
(.putString "save-1" (pr-str (entities :state)))
|
(.putString name (pr-str (entities :state)))
|
||||||
.flush))
|
.flush))
|
||||||
|
|
||||||
|
(defn save [entities]
|
||||||
|
(snapshot-state entities "Autosave"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(defn has-save? []
|
(defn has-save? []
|
||||||
(-> (.getPreferences (Gdx/app) "ticks-tales-saves")
|
(-> (.getPreferences (Gdx/app) "ticks-tales-saves")
|
||||||
(.contains "save-1")))
|
(.contains "Autosave")))
|
||||||
|
|
||||||
(defn load []
|
(defn load-snapshot [name]
|
||||||
(-> (.getPreferences (Gdx/app) "ticks-tales-saves")
|
(-> (.getPreferences (Gdx/app) "ticks-tales-saves")
|
||||||
(.getString "save-1")
|
(.getString name)
|
||||||
edn/read-string
|
edn/read-string
|
||||||
(assoc :active? true)))
|
(assoc :active? true)))
|
||||||
|
|
||||||
|
(defn load []
|
||||||
|
(load-snapshot "Autosave"))
|
||||||
|
|
||||||
(defn save-settings [entities]
|
(defn save-settings [entities]
|
||||||
(doto (.getPreferences (Gdx/app) "ticks-tales-saves")
|
(doto (.getPreferences (Gdx/app) "ticks-tales-saves")
|
||||||
(.putString "settings" (pr-str @settings))
|
(.putString "settings" (pr-str @settings))
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
(ns advent.core.desktop-launcher
|
(ns advent.core.desktop-launcher
|
||||||
(:require [advent.core :refer :all]
|
(:require [advent.core :refer :all]
|
||||||
[clojure.tools.nrepl.server])
|
#_[clojure.tools.nrepl.server])
|
||||||
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication LwjglApplicationConfiguration]
|
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication LwjglApplicationConfiguration]
|
||||||
[org.lwjgl.input Keyboard]
|
[org.lwjgl.input Keyboard]
|
||||||
[com.badlogic.gdx Gdx])
|
[com.badlogic.gdx Gdx])
|
||||||
(:gen-class))
|
(:gen-class))
|
||||||
|
|
||||||
(defmacro start-nrepl-expr [port]
|
#_(defmacro start-nrepl-expr [port]
|
||||||
`(let [{port# :port} (clojure.tools.nrepl.server/start-server :port ~port)]
|
`(let [{port# :port} (clojure.tools.nrepl.server/start-server :port ~port)]
|
||||||
(doseq [port-file# ["target/repl-port" ".nrepl-port"]]
|
(doseq [port-file# ["target/repl-port" ".nrepl-port"]]
|
||||||
(-> port-file#
|
(-> port-file#
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
(defn -main
|
(defn -main
|
||||||
[& [port]]
|
[& [port]]
|
||||||
(try
|
#_(try
|
||||||
(when port (start-nrepl-expr (Integer/parseInt port)))
|
(when port (start-nrepl-expr (Integer/parseInt port)))
|
||||||
(catch Exception e))
|
(catch Exception e))
|
||||||
(let [cfg (LwjglApplicationConfiguration.)]
|
(let [cfg (LwjglApplicationConfiguration.)]
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
:description "FIXME: write description"
|
:description "FIXME: write description"
|
||||||
:dependencies [[com.badlogicgames.gdx/gdx "1.5.3"]
|
:dependencies [[com.badlogicgames.gdx/gdx "1.5.3"]
|
||||||
[com.badlogicgames.gdx/gdx-backend-robovm "1.5.3"]
|
[com.badlogicgames.gdx/gdx-backend-robovm "1.5.3"]
|
||||||
[com.badlogicgames.gdx/gdx-box2d "1.5.3"]
|
|
||||||
[com.badlogicgames.gdx/gdx-bullet "1.5.3"]
|
|
||||||
[org.clojure/data.priority-map "0.0.5"]
|
[org.clojure/data.priority-map "0.0.5"]
|
||||||
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
|
[org.clojure/core.async "0.1.346.0-17112a-alpha"]
|
||||||
[org.clojure/clojure "1.6.0"]
|
[org.clojure/clojure "1.6.0"]
|
||||||
@@ -16,7 +14,7 @@
|
|||||||
:plugins [[lein-fruit "0.2.4-SNAPSHOT"]]
|
:plugins [[lein-fruit "0.2.4-SNAPSHOT"]]
|
||||||
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
|
:javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"]
|
||||||
:ios {:robovm-opts ["-forcelinkclasses" "advent.**:clojure.**:com.badlogic.**:play_clj.**"
|
:ios {:robovm-opts ["-forcelinkclasses" "advent.**:clojure.**:com.badlogic.**:play_clj.**"
|
||||||
"-libs" "libs/libObjectAL.a:libs/libgdx.a:libs/libgdx-box2d.a:libs/libgdx-bullet.a"
|
"-libs" "libs/libObjectAL.a:libs/libgdx.a"
|
||||||
"-frameworks" "UIKit:OpenGLES:QuartzCore:CoreGraphics:OpenAL:AudioToolbox:AVFoundation"
|
"-frameworks" "UIKit:OpenGLES:QuartzCore:CoreGraphics:OpenAL:AudioToolbox:AVFoundation"
|
||||||
"-resources" "../desktop/resources/**"
|
"-resources" "../desktop/resources/**"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user