first attempt at saving/loading.
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
(:require [play-clj.core :refer :all]
|
||||
[play-clj.ui :refer :all]
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all])
|
||||
[play-clj.g2d :refer :all]
|
||||
[clojure.edn :as edn])
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
[java.lang Object]))
|
||||
@@ -25,6 +26,11 @@
|
||||
0 0 target-width target-height)
|
||||
resized ))
|
||||
|
||||
(defn save [entities]
|
||||
(spit "save.edn" (entities :state)))
|
||||
|
||||
(defn load []
|
||||
(edn/read-string (slurp "save.edn")))
|
||||
|
||||
(defn get-font [filename]
|
||||
(let [font (bitmap-font filename)
|
||||
|
||||
Reference in New Issue
Block a user