first stab at android.

This commit is contained in:
Bryce Covert
2017-09-21 07:28:27 -07:00
parent af87521da1
commit e02542270e
5 changed files with 41 additions and 17 deletions

View File

@@ -19,8 +19,9 @@
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
[com.badlogic.gdx.graphics.g2d TextureRegion]
[com.badlogic.gdx Gdx Application]
[java.io FileOutputStream File PrintStream])
)
[java.io FileOutputStream File PrintStream]))
(def has-purchased? (atom false))
(defonce am (asset-manager))

View File

@@ -17,7 +17,8 @@
[play-clj.ui :refer :all]
[play-clj.utils :refer :all]
[play-clj.g2d :refer :all])
(:import [com.badlogic.gdx.graphics Color]))
(:import [com.badlogic.gdx.graphics Color]
[com.badlogic.gdx Application Gdx]))
(println "loading " *ns*)
@@ -377,8 +378,15 @@
:label "Pit of destiny"
:cursor :look
:script (actions/get-script entities
(actions/walk-to entities :ego [154 41])
(actions/talk entities :ego "Wow! That's a long way down."))
(println "billing purchased before" @@(resolve 'advent.core/has-purchased?))
(when-not @@(resolve 'advent.core/has-purchased?)
(.triggerPurchase (Gdx/app))
(a/<!! @(resolve 'advent.android/purchase-chan)))
(println "billing purchased now:" @@(resolve 'advent.core/has-purchased?))
(when @@(resolve 'advent.core/has-purchased?)
(actions/walk-to entities :ego [154 41])
(actions/talk entities :ego "Wow! That's a long way down.")))
:scripts {:shovel (actions/get-script entities
(actions/walk-to entities :ego [154 41])
(actions/talk entities :ego "I guess I'm doomed to be a gravedigger.")