Add '-game' to game object name to prevent name clashes

This commit is contained in:
oakes
2015-02-28 23:27:41 -05:00
parent 8cd2e32553
commit f74c5d7820
5 changed files with 5 additions and 6 deletions

View File

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

View File

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

View File

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

View File

@@ -13,7 +13,7 @@
(clear!)
(render! screen entities)))
(defgame {{app-name}}
(defgame {{game-name}}
:on-create
(fn [this]
(set-screen! this main-screen)))

View File

@@ -6,5 +6,5 @@
(defn -main
[]
(LwjglApplication. {{app-name}} "{{app-name}}" 800 600)
(LwjglApplication. {{game-name}} "{{app-name}}" 800 600)
(Keyboard/enableRepeatEvents true))