Saturday, October 8, 2011

Bobbing for crates

I wasn't happy that I had this fancy dancy new water texture but no physics behind it to make things (like crates) float.  I went out and discovered that the Box2DFlash port by "BoristheBrave" had already implemented this.  I ported that over to the libgdx library... and was able to do it by adding shape extensions so I didn't need any updates to the underlying libgdx JNI code which was cool.  After realizing that Box2DFlash's coordinate y-axis was inverted from my environment's y-axis AND fixing a couple of bugs I introduced, it's now working flawlessly.  Here's a screen shot of a couple of crates floating:

One other thing that I did last night was to integrate ACRA.  This is Application Crash Reporting for Android.  If you give your application Internet permission, it will send crashes off to Google docs for analysis.  This will give you the trace you need that the standard 'Force Close' window absolutely does not provide.

The best thing about this is that the overall impact on the app is minimal.  You add a new class and override the onCreate() method in that class, set up a Google docs form, and you are ready to go.  I was a bit confused at first because I wasn't sure how to integrate it with libgdx, but it really boils down to just adding the class as part of the Android project & including the acra .JAR file.  QED!

No comments:

Post a Comment