commit 2c38a57e48d995a953e15a33c321afac46b51280 Author: Bryce Covert Date: Tue Aug 26 19:26:58 2014 -0700 first. diff --git a/README.md b/README.md new file mode 100644 index 00000000..9cba0970 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +## Introduction + +A play-clj game in which ... well, that part is up to you. + +## Contents + +* `android/src` Android-specific code +* `desktop/resources` Images, audio, and other files +* `desktop/src` Desktop-specific code +* `desktop/src-common` Cross-platform game code +* `ios/src` iOS-specific code + +## Building + +All projects can be built using [Nightcode](https://nightcode.info/), or on the command line using [Leiningen](https://github.com/technomancy/leiningen) with the [lein-droid](https://github.com/clojure-android/lein-droid) and [lein-fruit](https://github.com/oakes/lein-fruit) plugins. diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml new file mode 100644 index 00000000..8cac0f4b --- /dev/null +++ b/android/AndroidManifest.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/android/libs/armeabi-v7a/libgdx-box2d.so b/android/libs/armeabi-v7a/libgdx-box2d.so new file mode 100644 index 00000000..47532cac Binary files /dev/null and b/android/libs/armeabi-v7a/libgdx-box2d.so differ diff --git a/android/libs/armeabi-v7a/libgdx-bullet.so b/android/libs/armeabi-v7a/libgdx-bullet.so new file mode 100644 index 00000000..f34369bb Binary files /dev/null and b/android/libs/armeabi-v7a/libgdx-bullet.so differ diff --git a/android/libs/armeabi-v7a/libgdx.so b/android/libs/armeabi-v7a/libgdx.so new file mode 100644 index 00000000..6bb99802 Binary files /dev/null and b/android/libs/armeabi-v7a/libgdx.so differ diff --git a/android/libs/armeabi/libgdx-box2d.so b/android/libs/armeabi/libgdx-box2d.so new file mode 100644 index 00000000..10eefd03 Binary files /dev/null and b/android/libs/armeabi/libgdx-box2d.so differ diff --git a/android/libs/armeabi/libgdx-bullet.so b/android/libs/armeabi/libgdx-bullet.so new file mode 100644 index 00000000..57e416e6 Binary files /dev/null and b/android/libs/armeabi/libgdx-bullet.so differ diff --git a/android/libs/armeabi/libgdx.so b/android/libs/armeabi/libgdx.so new file mode 100644 index 00000000..9e4119b1 Binary files /dev/null and b/android/libs/armeabi/libgdx.so differ diff --git a/android/libs/x86/libgdx-box2d.so b/android/libs/x86/libgdx-box2d.so new file mode 100644 index 00000000..63538985 Binary files /dev/null and b/android/libs/x86/libgdx-box2d.so differ diff --git a/android/libs/x86/libgdx-bullet.so b/android/libs/x86/libgdx-bullet.so new file mode 100644 index 00000000..3037aa66 Binary files /dev/null and b/android/libs/x86/libgdx-bullet.so differ diff --git a/android/libs/x86/libgdx.so b/android/libs/x86/libgdx.so new file mode 100644 index 00000000..6afee9cc Binary files /dev/null and b/android/libs/x86/libgdx.so differ diff --git a/android/project.clj b/android/project.clj new file mode 100644 index 00000000..f2eb7962 --- /dev/null +++ b/android/project.clj @@ -0,0 +1,37 @@ +(defproject advent "0.0.1-SNAPSHOT" + :description "FIXME: write description" + + :dependencies [[com.badlogicgames.gdx/gdx "1.3.0" :use-resources true] + [com.badlogicgames.gdx/gdx-backend-android "1.3.0"] + [com.badlogicgames.gdx/gdx-box2d "1.3.0"] + [com.badlogicgames.gdx/gdx-bullet "1.3.0"] + [neko/neko "3.0.2"] + [org.clojure-android/clojure "1.6.0-RC1" :use-resources true] + [play-clj "0.3.9"]] + :profiles {:dev {:dependencies [[android/tools.nrepl "0.2.0-bigstack"] + [compliment "0.1.3"]] + :android {:aot :all-with-unused}} + :release {:android + {;; Specify the path to your private + ;; keystore and the the alias of the + ;; key you want to sign APKs with. + ;; :keystore-path "/home/user/.android/private.keystore" + ;; :key-alias "mykeyalias" + :aot :all}}} + + :android {;; Specify the path to the Android SDK directory either + ;; here or in your ~/.lein/profiles.clj file. + ;; :sdk-path "/home/user/path/to/android-sdk/" + + ;; Uncomment this if dexer fails with OutOfMemoryException + ;; :force-dex-optimize true + + :assets-path "../desktop/resources" + :native-libraries-paths ["libs"] + :target-version "15" + :aot-exclude-ns ["clojure.parallel" "clojure.core.reducers"] + :dex-opts ["-JXmx2048M"]} + + :source-paths ["src/clojure" "../desktop/src-common"] + :java-source-paths ["src/java" "gen"] + :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]) diff --git a/android/res/anim/splash_rotation.xml b/android/res/anim/splash_rotation.xml new file mode 100644 index 00000000..c6a6554a --- /dev/null +++ b/android/res/anim/splash_rotation.xml @@ -0,0 +1,11 @@ + + + + diff --git a/android/res/drawable-hdpi/ic_launcher.png b/android/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 00000000..41ce75ec Binary files /dev/null and b/android/res/drawable-hdpi/ic_launcher.png differ diff --git a/android/res/drawable-hdpi/splash_circle.png b/android/res/drawable-hdpi/splash_circle.png new file mode 100644 index 00000000..33128e3d Binary files /dev/null and b/android/res/drawable-hdpi/splash_circle.png differ diff --git a/android/res/drawable-hdpi/splash_droid.png b/android/res/drawable-hdpi/splash_droid.png new file mode 100644 index 00000000..ce862fc5 Binary files /dev/null and b/android/res/drawable-hdpi/splash_droid.png differ diff --git a/android/res/drawable-hdpi/splash_hands.png b/android/res/drawable-hdpi/splash_hands.png new file mode 100644 index 00000000..a70864e3 Binary files /dev/null and b/android/res/drawable-hdpi/splash_hands.png differ diff --git a/android/res/drawable-ldpi/ic_launcher.png b/android/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 00000000..6b37376b Binary files /dev/null and b/android/res/drawable-ldpi/ic_launcher.png differ diff --git a/android/res/drawable-mdpi/ic_launcher.png b/android/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 00000000..a6bd3047 Binary files /dev/null and b/android/res/drawable-mdpi/ic_launcher.png differ diff --git a/android/res/drawable/splash_background.xml b/android/res/drawable/splash_background.xml new file mode 100644 index 00000000..bd3ab4b8 --- /dev/null +++ b/android/res/drawable/splash_background.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/android/res/layout/splashscreen.xml b/android/res/layout/splashscreen.xml new file mode 100644 index 00000000..47ea9fdd --- /dev/null +++ b/android/res/layout/splashscreen.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml new file mode 100644 index 00000000..5d433ee7 --- /dev/null +++ b/android/res/values/strings.xml @@ -0,0 +1,6 @@ + + + + advent + + diff --git a/android/src/java/advent/core/AndroidLauncher.java b/android/src/java/advent/core/AndroidLauncher.java new file mode 100644 index 00000000..f5ef5562 --- /dev/null +++ b/android/src/java/advent/core/AndroidLauncher.java @@ -0,0 +1,20 @@ +package advent.core; + +import clojure.lang.RT; +import clojure.lang.Symbol; + +import com.badlogic.gdx.backends.android.AndroidApplication; +import com.badlogic.gdx.Game; + +public class AndroidLauncher extends AndroidApplication { + public void onCreate (android.os.Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + RT.var("clojure.core", "require").invoke(Symbol.intern("advent.core")); + try { + Game game = (Game) RT.var("advent.core", "advent").deref(); + initialize(game); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/android/src/java/advent/core/SplashActivity.java b/android/src/java/advent/core/SplashActivity.java new file mode 100644 index 00000000..f1186880 --- /dev/null +++ b/android/src/java/advent/core/SplashActivity.java @@ -0,0 +1,74 @@ +package advent.core; + +import android.app.Activity; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.os.Bundle; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.widget.ImageView; +import android.widget.TextView; +import android.util.Log; + +import clojure.lang.Symbol; +import clojure.lang.Var; +import clojure.lang.RT; + +import advent.core.R; + +public class SplashActivity extends Activity { + + private static boolean firstLaunch = true; + private static String TAG = "Splash"; + + @Override + public void onCreate(Bundle bundle) { + super.onCreate(bundle); + + if (firstLaunch) { + firstLaunch = false; + setupSplash(); + loadClojure(); + } else { + proceed(); + } + } + + public void setupSplash() { + setContentView(R.layout.splashscreen); + + TextView appNameView = (TextView)findViewById(R.id.splash_app_name); + appNameView.setText(R.string.app_name); + + Animation rotation = AnimationUtils.loadAnimation(this, R.anim.splash_rotation); + ImageView circleView = (ImageView)findViewById(R.id.splash_circles); + circleView.startAnimation(rotation); + } + + public void proceed() { + startActivity(new Intent("advent.core.MAIN")); + finish(); + } + + public void loadClojure() { + new Thread(new Runnable(){ + @Override + public void run() { + Symbol CLOJURE_MAIN = Symbol.intern("neko.init"); + Var REQUIRE = RT.var("clojure.core", "require"); + REQUIRE.invoke(CLOJURE_MAIN); + + Var INIT = RT.var("neko.init", "init"); + INIT.invoke(SplashActivity.this.getApplication()); + + try { + Class.forName("advent.core.AndroidLauncher"); + } catch (ClassNotFoundException e) { + Log.e(TAG, "Failed loading AndroidLauncher", e); + } + + proceed(); + } + }).start(); + } +} diff --git a/desktop/project.clj b/desktop/project.clj new file mode 100644 index 00000000..2215da1e --- /dev/null +++ b/desktop/project.clj @@ -0,0 +1,20 @@ +(defproject advent "0.0.1-SNAPSHOT" + :description "FIXME: write description" + + :dependencies [[com.badlogicgames.gdx/gdx "1.3.0"] + [com.badlogicgames.gdx/gdx-backend-lwjgl "1.3.0"] + [com.badlogicgames.gdx/gdx-box2d "1.3.0"] + [com.badlogicgames.gdx/gdx-box2d-platform "1.3.0" + :classifier "natives-desktop"] + [com.badlogicgames.gdx/gdx-bullet "1.3.0"] + [com.badlogicgames.gdx/gdx-bullet-platform "1.3.0" + :classifier "natives-desktop"] + [com.badlogicgames.gdx/gdx-platform "1.3.0" + :classifier "natives-desktop"] + [org.clojure/clojure "1.6.0"] + [play-clj "0.3.9"]] + + :source-paths ["src" "src-common"] + :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"] + :aot [advent.core.desktop-launcher] + :main advent.core.desktop-launcher) diff --git a/desktop/resources/bg.png b/desktop/resources/bg.png new file mode 100644 index 00000000..31d6392a Binary files /dev/null and b/desktop/resources/bg.png differ diff --git a/desktop/resources/bg2.png b/desktop/resources/bg2.png new file mode 100644 index 00000000..7c92a35b Binary files /dev/null and b/desktop/resources/bg2.png differ diff --git a/desktop/resources/bg2.pxi b/desktop/resources/bg2.pxi new file mode 100644 index 00000000..4712de0f Binary files /dev/null and b/desktop/resources/bg2.pxi differ diff --git a/desktop/resources/bg3.png b/desktop/resources/bg3.png new file mode 100644 index 00000000..ff3163d3 Binary files /dev/null and b/desktop/resources/bg3.png differ diff --git a/desktop/resources/bg3.pxi b/desktop/resources/bg3.pxi new file mode 100644 index 00000000..c277f041 Binary files /dev/null and b/desktop/resources/bg3.pxi differ diff --git a/desktop/resources/left.pxa/0.pxi b/desktop/resources/left.pxa/0.pxi new file mode 100644 index 00000000..f3576aa8 Binary files /dev/null and b/desktop/resources/left.pxa/0.pxi differ diff --git a/desktop/resources/left.pxa/1.pxi b/desktop/resources/left.pxa/1.pxi new file mode 100644 index 00000000..18579845 Binary files /dev/null and b/desktop/resources/left.pxa/1.pxi differ diff --git a/desktop/resources/left.pxa/2.pxi b/desktop/resources/left.pxa/2.pxi new file mode 100644 index 00000000..7f72456f Binary files /dev/null and b/desktop/resources/left.pxa/2.pxi differ diff --git a/desktop/resources/left.pxa/3.pxi b/desktop/resources/left.pxa/3.pxi new file mode 100644 index 00000000..0b75c089 Binary files /dev/null and b/desktop/resources/left.pxa/3.pxi differ diff --git a/desktop/resources/left.pxa/4.pxi b/desktop/resources/left.pxa/4.pxi new file mode 100644 index 00000000..64d1739f Binary files /dev/null and b/desktop/resources/left.pxa/4.pxi differ diff --git a/desktop/resources/left.pxa/5.pxi b/desktop/resources/left.pxa/5.pxi new file mode 100644 index 00000000..b217839c Binary files /dev/null and b/desktop/resources/left.pxa/5.pxi differ diff --git a/desktop/resources/left.pxa/6.pxi b/desktop/resources/left.pxa/6.pxi new file mode 100644 index 00000000..a055f06d Binary files /dev/null and b/desktop/resources/left.pxa/6.pxi differ diff --git a/desktop/resources/left.pxa/7.pxi b/desktop/resources/left.pxa/7.pxi new file mode 100644 index 00000000..c30e2643 Binary files /dev/null and b/desktop/resources/left.pxa/7.pxi differ diff --git a/desktop/resources/left.pxa/CelData.plist b/desktop/resources/left.pxa/CelData.plist new file mode 100644 index 00000000..25420d7f --- /dev/null +++ b/desktop/resources/left.pxa/CelData.plist @@ -0,0 +1,38 @@ + + + + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + diff --git a/desktop/resources/pal.pxpalette b/desktop/resources/pal.pxpalette new file mode 100644 index 00000000..5734a284 Binary files /dev/null and b/desktop/resources/pal.pxpalette differ diff --git a/desktop/resources/player.png b/desktop/resources/player.png new file mode 100644 index 00000000..6618be42 Binary files /dev/null and b/desktop/resources/player.png differ diff --git a/desktop/resources/right.pxa/0.pxi b/desktop/resources/right.pxa/0.pxi new file mode 100644 index 00000000..fe0c9d4d Binary files /dev/null and b/desktop/resources/right.pxa/0.pxi differ diff --git a/desktop/resources/right.pxa/1.pxi b/desktop/resources/right.pxa/1.pxi new file mode 100644 index 00000000..f6c5272e Binary files /dev/null and b/desktop/resources/right.pxa/1.pxi differ diff --git a/desktop/resources/right.pxa/2.pxi b/desktop/resources/right.pxa/2.pxi new file mode 100644 index 00000000..7d539de4 Binary files /dev/null and b/desktop/resources/right.pxa/2.pxi differ diff --git a/desktop/resources/right.pxa/3.pxi b/desktop/resources/right.pxa/3.pxi new file mode 100644 index 00000000..7c403a6e Binary files /dev/null and b/desktop/resources/right.pxa/3.pxi differ diff --git a/desktop/resources/right.pxa/4.pxi b/desktop/resources/right.pxa/4.pxi new file mode 100644 index 00000000..4226eb21 Binary files /dev/null and b/desktop/resources/right.pxa/4.pxi differ diff --git a/desktop/resources/right.pxa/5.pxi b/desktop/resources/right.pxa/5.pxi new file mode 100644 index 00000000..5b04c7db Binary files /dev/null and b/desktop/resources/right.pxa/5.pxi differ diff --git a/desktop/resources/right.pxa/6.pxi b/desktop/resources/right.pxa/6.pxi new file mode 100644 index 00000000..70a8f317 Binary files /dev/null and b/desktop/resources/right.pxa/6.pxi differ diff --git a/desktop/resources/right.pxa/7.pxi b/desktop/resources/right.pxa/7.pxi new file mode 100644 index 00000000..ec34ca98 Binary files /dev/null and b/desktop/resources/right.pxa/7.pxi differ diff --git a/desktop/resources/right.pxa/CelData.plist b/desktop/resources/right.pxa/CelData.plist new file mode 100644 index 00000000..25420d7f --- /dev/null +++ b/desktop/resources/right.pxa/CelData.plist @@ -0,0 +1,38 @@ + + + + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + duration + 0.10000000149011612 + + + diff --git a/desktop/src-common/advent/core.clj b/desktop/src-common/advent/core.clj new file mode 100644 index 00000000..10f12de2 --- /dev/null +++ b/desktop/src-common/advent/core.clj @@ -0,0 +1,47 @@ +(ns advent.core + (:require [play-clj.core :refer :all] + [play-clj.ui :refer :all] + [play-clj.g2d :refer :all])) + +(defscreen main-screen + :on-show + (fn [screen entities] + (update! screen :renderer (stage) :camera (orthographic)) + (let [player-sheet (texture! (texture "player.png") :split 18 36) + background (texture "bg3.png")] + [(assoc background :scale-y 1.0 :scale-x 1.0 :origin-y 0 :origin-x 0 :ego? false :x -60 :y -34) + {:right (animation 0.1 (for [i (range 8)] + (texture (aget player-sheet 0 i)))) + :left (animation 0.1 (for [i (range 8)] + (texture (aget player-sheet 1 i)))) + :anim (animation 0.1 (for [i (range 8)] + (texture (aget player-sheet 0 i)))) + :x 0 :y 25 :origin-x 0 :origin-y 0 :x-velocity 1 + :ego? true}])) + + :on-render + (fn [screen entities] + (clear!) + (render! screen (for [entity entities] + (if (:ego? entity) + (merge (animation->texture screen (:anim entity)) + {:ego? (:ego? entity) :x (+ (:x entity) (:x-velocity entity)) :y 0 :origin-x 0 :origin-y 0 :anim (:anim entity) :x-velocity (:x-velocity entity) :left (:left entity) :right (:right entity)} + (when (> (:x entity) (width screen)) + {:x-velocity -1 :anim (:left entity)}) + (when (< (:x entity) 0) + {:x-velocity 1 :anim (:right entity)})) + + entity)))) + :on-resize + (fn [screen entities] + (height! screen 135)) + + :on-scrolled + (fn [screen entities] + (set! (. (:camera screen) zoom) (min 1.5 (max (+ (.zoom (:camera screen)) (* 0.01 (:amount screen))) 1))) + nil)) + +(defgame advent + :on-create + (fn [this] + (set-screen! this main-screen))) diff --git a/desktop/src/advent/core/desktop_launcher.clj b/desktop/src/advent/core/desktop_launcher.clj new file mode 100644 index 00000000..483b5271 --- /dev/null +++ b/desktop/src/advent/core/desktop_launcher.clj @@ -0,0 +1,10 @@ +(ns advent.core.desktop-launcher + (:require [advent.core :refer :all]) + (:import [com.badlogic.gdx.backends.lwjgl LwjglApplication] + [org.lwjgl.input Keyboard]) + (:gen-class)) + +(defn -main + [] + (LwjglApplication. advent "advent" 1920 1080) + (Keyboard/enableRepeatEvents true)) diff --git a/ios/Info.plist.xml b/ios/Info.plist.xml new file mode 100644 index 00000000..fd3d53ff --- /dev/null +++ b/ios/Info.plist.xml @@ -0,0 +1,61 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + advent + CFBundleExecutable + advent + CFBundleIdentifier + advent.core + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + advent + CFBundlePackageType + APPL + CFBundleShortVersionString + ${app.version} + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + Icon + Icon-72 + + + + + diff --git a/ios/libs/libObjectAL.a b/ios/libs/libObjectAL.a new file mode 100644 index 00000000..95969cb7 Binary files /dev/null and b/ios/libs/libObjectAL.a differ diff --git a/ios/libs/libgdx-box2d.a b/ios/libs/libgdx-box2d.a new file mode 100644 index 00000000..a8bcffca Binary files /dev/null and b/ios/libs/libgdx-box2d.a differ diff --git a/ios/libs/libgdx-bullet.a b/ios/libs/libgdx-bullet.a new file mode 100644 index 00000000..bb80ec0e Binary files /dev/null and b/ios/libs/libgdx-bullet.a differ diff --git a/ios/libs/libgdx.a b/ios/libs/libgdx.a new file mode 100644 index 00000000..cf8eadaa Binary files /dev/null and b/ios/libs/libgdx.a differ diff --git a/ios/project.clj b/ios/project.clj new file mode 100644 index 00000000..3ef92c86 --- /dev/null +++ b/ios/project.clj @@ -0,0 +1,17 @@ +(defproject advent "0.0.1-SNAPSHOT" + :description "FIXME: write description" + :dependencies [[com.badlogicgames.gdx/gdx "1.3.0"] + [com.badlogicgames.gdx/gdx-backend-robovm "1.3.0"] + [com.badlogicgames.gdx/gdx-box2d "1.3.0"] + [com.badlogicgames.gdx/gdx-bullet "1.3.0"] + [org.clojure/clojure "1.6.0"] + [play-clj "0.3.9"]] + :source-paths ["src/clojure" "../desktop/src-common"] + :java-source-paths ["src/java"] + :javac-options ["-target" "1.7" "-source" "1.7" "-Xlint:-options"] + :ios {:robovm-opts ["-forcelinkclasses" "advent.**:clojure.**:com.badlogic.**:play_clj.**" + "-libs" "libs/libObjectAL.a:libs/libgdx.a:libs/libgdx-box2d.a:libs/libgdx-bullet.a" + "-frameworks" "UIKit:OpenGLES:QuartzCore:CoreGraphics:OpenAL:AudioToolbox:AVFoundation" + "-resources" "../desktop/resources/**"]} + :aot :all + :main advent.core.IOSLauncher) diff --git a/ios/src/java/advent/core/IOSLauncher.java b/ios/src/java/advent/core/IOSLauncher.java new file mode 100644 index 00000000..9f60f9be --- /dev/null +++ b/ios/src/java/advent/core/IOSLauncher.java @@ -0,0 +1,30 @@ +package advent.core; + +import clojure.lang.RT; +import clojure.lang.Symbol; + +import com.badlogic.gdx.*; +import com.badlogic.gdx.backends.iosrobovm.*; + +import org.robovm.apple.foundation.*; +import org.robovm.apple.uikit.*; + +public class IOSLauncher extends IOSApplication.Delegate { + protected IOSApplication createApplication() { + IOSApplicationConfiguration config = new IOSApplicationConfiguration(); + RT.var("clojure.core", "require").invoke(Symbol.intern("advent.core")); + try { + Game game = (Game) RT.var("advent.core", "advent").deref(); + return new IOSApplication(game, config); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + public static void main(String[] argv) { + NSAutoreleasePool pool = new NSAutoreleasePool(); + UIApplication.main(argv, null, IOSLauncher.class); + pool.close(); + } +}