Skip to content

Commit

Permalink
Merge pull request #6 from DaanVanYperen/develop
Browse files Browse the repository at this point in the history
Release 1.1
  • Loading branch information
DaanVanYperen committed May 27, 2015
2 parents 0e806ab + a2ab6e2 commit d9fc5ac
Show file tree
Hide file tree
Showing 118 changed files with 954 additions and 3,734 deletions.
26 changes: 14 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ hs_err_pid*

## GWT
war/
war/gwt_bree/
gwt-unitCache/
html/war/gwt_bree/
html/gwt-unitCache/
.apt_generated/
war/WEB-INF/deploy/
war/WEB-INF/classes/
html/war/WEB-INF/deploy/
html/war/WEB-INF/classes/
.gwt/
gwt-unitCache/
www-test/
.gwt-tmp/

## Android Studio and Intellij and Android in general
libs/armeabi/
libs/armeabi-v7a/
libs/x86/
gen/
android/libs/armeabi/
android/libs/armeabi-v7a/
android/libs/x86/
android/gen/
.idea/
*.ipr
*.iws
Expand All @@ -33,7 +33,7 @@ com_crashlytics_export_strings.xml
.classpath
.project
.metadata
bin/
**/bin/
tmp/
*.tmp
*.bak
Expand All @@ -46,7 +46,7 @@ local.properties
*.launch

## NetBeans
nbproject/private/
**/nbproject/private/
build/
nbbuild/
dist/
Expand All @@ -57,6 +57,8 @@ nb-configuration.xml
## Gradle

.gradle
gradle-app.setting
build/
android/libs/armeabi-v7a/libgdx.so
gradle/wrapper/gradle-wrapper.properties

## OS Specific
.DS_Store
76 changes: 49 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,68 @@
libgdx-artemis-quickstart
=========================

Quickstart for desktop and html libgdx artemis-odb based jam games.
Quickstart for libgdx artemis-odb based games.

Contains a very basic game that demos some typical systems and components.

[Play Slumber here](http://www.mostlyoriginal.net/play-slumber/)
Preconfigured for artemis-odb advanced features. Contains
a logo screen with artemis feature detection and minimal
game scaffold.

### When to use this

If you want artemis-odb with LibGDX's new gradle setup, or you need
some quick ideas for an entry level component/system setup, a fork
will get you up and running quickly.
If you want artemis-odb with weaving, entity factories and
LibGDX's gradle, a fork will get you up and running quickly.

I use this as my quickstart for jam games. You are welcome
to use it for whatever you need.

### Where to start

Edit `net.mostlyoriginal.game.screen.GameScreen` and start
adding systems!

Running the game displays a odb feature splash screen,
before transitioning to your game.

### Feature detection!

Splash screen icons show available features:

| Icon | Platform supports/feature active
|-----------------------|----------------------------------
| Three big squares | @PackedWeaver
| Tiny squares in a box | @PooledWeaver
| Linked squares | Hotspot optimization
| Factory icon | ODB Factories

### Platform cheat sheet

| Platform | [odb weaving](https://github.com/junkdog/artemis-odb/wiki/Bytecode-weaving) | [entity factory](https://github.com/junkdog/artemis-odb/wiki/EntityFactory) | quickstart
|-----------------|----------|----------------|--------------------
| Desktop | ✓ | ✓ | `gradlew desktop:run`
| Android | ✓ | ✓ | `gradlew android:installDebug android:run`, launch emulator first.
| iOS | ✓ | ✓ | `gradlew ios:launchIPhoneSimulator`
| HTML5/GWT | - | ✓ | `gradlew html:superDev`, browse to `http://localhost:8080/html`

I use this as my launchpad for jam games. You are welcome to use
it for whatever you need. I might separate the component/systems
into a library later, no guarantees. ;)
✓ supported, - not supported

### Library Versions

LibGDX 1.5.3 and Artemis-ODB 0.9
(LibGDX version can be changed in /build.gradle)
LibGDX 1.6.1, Artemis-odb 0.9.1-SNAPSHOT, Artemis-odb-contrib 0.9.1

Tested for desktop:dist and html:dist targets. Others targets might function too. ;)
Alter library versions and enable gdx modules in /build.gradle

### Organization
### Weaving

net.mostlyoriginal.api contains all generic example components/systems.
net.mostlyoriginal.game contains an example game.
Weaving and entity factory creation are part of the core build step.

- Entrypoint for your game is ```net.mostlyoriginal.game.MyGame```
- Configure and add systems in ```net.mostlyoriginal.game.MainScreen```
- Resolution can be changed in G.java
### GWT and Reflection

### Special note on Reflection
GWT lacks reflection so the build process creates a reflection cache.

GWT lacks reflection so the build process creates a reflection cache. To use
```@Wire``` make sure your components, managers and systems are placed under
the premade component, manager and system packages.
To use `@Wire` make sure your components, managers and systems are
placed under the premade component, manager and system packages.

Artemis does not share libgdx's reflection cache, so if you get gwt reflection
related errors you might need to add classes to Libgdx's cache manually.
Artemis reflection cache errors are prefixed with artemis-odb.
There are TWO reflection caches, one for LibGDX, one for Artemis-ODB.
Artemis reflection cache errors are prefixed with `artemis-odb`.

```
```
6 changes: 3 additions & 3 deletions android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19" />
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:theme="@style/GdxTheme" >
<activity
android:name="net.mostlyoriginal.game.android.AndroidLauncher"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:configChanges="keyboard|keyboardHidden|orientation">
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Binary file removed android/assets/art8.png
Binary file not shown.
Binary file added android/assets/dancingman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 0 additions & 130 deletions android/assets/level1.tmx

This file was deleted.

Binary file modified android/assets/tiles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 21 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
android {
buildToolsVersion "19.0.3"
compileSdkVersion 19
buildToolsVersion "20.0.0"
compileSdkVersion 21
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
Expand Down Expand Up @@ -46,7 +45,24 @@ task copyAndroidNatives() {
}

task run(type: Exec) {
def adb = "$System.env.ANDROID_HOME/platform-tools/adb"
def path
def localProperties = project.file("../local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream { instr ->
properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
if (sdkDir) {
path = sdkDir
} else {
path = "$System.env.ANDROID_HOME"
}
} else {
path = "$System.env.ANDROID_HOME"
}

def adb = path + "/platform-tools/adb"
commandLine "$adb", 'shell', 'am', 'start', '-n', 'net.mostlyoriginal.game.android/net.mostlyoriginal.game.android.AndroidLauncher'
}

Expand All @@ -66,7 +82,7 @@ eclipse {
}

classpath {
plusConfigurations += project.configurations.compile
plusConfigurations += [ project.configurations.compile ]
containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
}

Expand Down
Binary file removed android/libs/armeabi-v7a/libgdx.so
Binary file not shown.
Binary file removed android/libs/armeabi/libgdx.so
Binary file not shown.
Binary file removed android/libs/x86/libgdx.so
Binary file not shown.
22 changes: 22 additions & 0 deletions android/proguard-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,25 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

-verbose

-dontwarn android.support.**
-dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication
-dontwarn com.badlogic.gdx.utils.GdxBuild
-dontwarn com.badlogic.gdx.physics.box2d.utils.Box2DBuild
-dontwarn com.badlogic.gdx.jnigen.BuildTarget*

-keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* {
<init>(com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration);
}

-keepclassmembers class com.badlogic.gdx.physics.box2d.World {
boolean contactFilter(long, long);
void beginContact(long);
void endContact(long);
void preSolve(long, long);
void postSolve(long, long);
boolean reportFixture(long);
float reportRayFixture(long, float, float, float, float, float);
}
2 changes: 1 addition & 1 deletion android/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">GameTemplate</string>
<string name="app_name">libgdx-artemis-quickstart</string>

</resources>
Loading

0 comments on commit d9fc5ac

Please sign in to comment.