Add '-game' to game object name to prevent name clashes
This commit is contained in:
@@ -6,8 +6,6 @@
|
||||
|
||||
(defn play-clj
|
||||
[name & [package-name]]
|
||||
(when (contains? #{"game" "main-screen"} name)
|
||||
(main/abort "Choose a more creative name than that, silly!"))
|
||||
(let [render (t/renderer "play-clj")
|
||||
lein-droid-render (droid-new/renderer "templates")
|
||||
desktop-class-name "desktop-launcher"
|
||||
@@ -21,6 +19,7 @@
|
||||
android-ns (str package-name "." android-class-name)
|
||||
ios-ns (str package-name "." ios-class-name)
|
||||
data {:app-name name
|
||||
:game-name (str name "-game")
|
||||
:name (t/project-name name)
|
||||
:package package-name
|
||||
:package-sanitized package-name
|
||||
|
||||
@@ -11,7 +11,7 @@ public class {{android-class-name}} extends AndroidApplication {
|
||||
super.onCreate(savedInstanceState);
|
||||
RT.var("clojure.core", "require").invoke(Symbol.intern("{{namespace}}"));
|
||||
try {
|
||||
Game game = (Game) RT.var("{{namespace}}", "{{app-name}}").deref();
|
||||
Game game = (Game) RT.var("{{namespace}}", "{{game-name}}").deref();
|
||||
initialize(game);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -14,7 +14,7 @@ public class {{ios-class-name}} extends IOSApplication.Delegate {
|
||||
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
|
||||
RT.var("clojure.core", "require").invoke(Symbol.intern("{{namespace}}"));
|
||||
try {
|
||||
Game game = (Game) RT.var("{{namespace}}", "{{app-name}}").deref();
|
||||
Game game = (Game) RT.var("{{namespace}}", "{{game-name}}").deref();
|
||||
return new IOSApplication(game, config);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
(clear!)
|
||||
(render! screen entities)))
|
||||
|
||||
(defgame {{app-name}}
|
||||
(defgame {{game-name}}
|
||||
:on-create
|
||||
(fn [this]
|
||||
(set-screen! this main-screen)))
|
||||
|
||||
@@ -6,5 +6,5 @@
|
||||
|
||||
(defn -main
|
||||
[]
|
||||
(LwjglApplication. {{app-name}} "{{app-name}}" 800 600)
|
||||
(LwjglApplication. {{game-name}} "{{app-name}}" 800 600)
|
||||
(Keyboard/enableRepeatEvents true))
|
||||
|
||||
Reference in New Issue
Block a user