Make Android/iOS versions work
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
(ns play-clj.android)
|
|
||||||
6
android/src/play_clj/native.clj
Normal file
6
android/src/play_clj/native.clj
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
(ns play-clj.native
|
||||||
|
(:require [play-clj.core :refer :all]))
|
||||||
|
|
||||||
|
(defmacro defgame
|
||||||
|
[name & {:keys [] :as options}]
|
||||||
|
`(def ~name (create-game ~options)))
|
||||||
@@ -90,11 +90,7 @@
|
|||||||
[^Game game ^Screen screen]
|
[^Game game ^Screen screen]
|
||||||
(.setScreen game screen))
|
(.setScreen game screen))
|
||||||
|
|
||||||
(defn defgameobj*
|
(defn create-game
|
||||||
[{:keys [start-screen]}]
|
[{:keys [start-screen]}]
|
||||||
(proxy [Game] []
|
(proxy [Game] []
|
||||||
(create [] (when start-screen (set-screen! this start-screen)))))
|
(create [] (when start-screen (set-screen! this start-screen)))))
|
||||||
|
|
||||||
(defmacro defgameobj
|
|
||||||
[name options]
|
|
||||||
`(def ~name (defgameobj* ~options)))
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
(ns play-clj.desktop
|
(ns play-clj.native
|
||||||
(:require [play-clj.core :refer :all])
|
(:require [play-clj.core :refer :all])
|
||||||
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication]
|
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication]
|
||||||
[org.lwjgl.input Keyboard]))
|
[org.lwjgl.input Keyboard]))
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
width (or width 800)
|
width (or width 800)
|
||||||
height (or height 600)]
|
height (or height 600)]
|
||||||
`(do
|
`(do
|
||||||
(defgameobj ~name ~options)
|
(def ~name (create-game ~options))
|
||||||
(defn ~'-main
|
(defn ~'-main
|
||||||
[]
|
[]
|
||||||
(LwjglApplication. ~name ~title ~width ~height true)
|
(LwjglApplication. ~name ~title ~width ~height true)
|
||||||
@@ -1 +0,0 @@
|
|||||||
(ns play-clj.ios)
|
|
||||||
6
ios/src/play_clj/native.clj
Normal file
6
ios/src/play_clj/native.clj
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
(ns play-clj.native
|
||||||
|
(:require [play-clj.core :refer :all]))
|
||||||
|
|
||||||
|
(defmacro defgame
|
||||||
|
[name & {:keys [] :as options}]
|
||||||
|
`(def ~name (create-game ~options)))
|
||||||
Reference in New Issue
Block a user