first attempt at saving/loading.

This commit is contained in:
2014-11-22 13:00:40 -08:00
parent 64e0176e76
commit 54b1f1497a
3 changed files with 40 additions and 27 deletions

View File

@@ -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)