%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %> <% String topCopy = "public static GMonk"; int whichMenu = 3; %> <%@ include file="top.jsp" %>
|
Technical Details:
|
|
How Does It Work?
Gravity Monkey is built in Java™, specifically on the Java 2 Micro-Edition (J2ME) with the Connected Limited Device Configuration (CLDC). Download the J2ME Toolkit from Sun if you're interested in finding out detailed information about the API. Gravity Monkey ™ was built using the toolkit and Sun One for Java, which was once Forte for Java, which integrates everything nicely. And, of course, you'll need a device to test it with -- and Gravity Monkey has been extensively tested with the Motorola i85 and i50, available through Nextel. As if there wasn't enough AO (acronym overload) at this point, Gravity Monkey utilizes the Java Mobile Information Device Profile (MIDP), and the primary Java class that runs the application gmonkey.GMonkey is a subclass of the class javax.microedition.midlet.MIDlet. The MIDlet returns an instance of the class javax.microedition.lcdui.Display, which we set to subclasses of javax.microedition.lcdui.Canvas: our gmonkey.MSplash (which handles the splash screen and the final score screen) or gmonkey.MCanvas (which handles the actual game). The help screen is handled within gmonkey.GMonkey itself, although it could have warranted a separate subclass of Canvas.
Click below to see a simplistic UML Class Diagram of all the classes involved in Gravity Monkey:
The gmonkey.MCanvas class that manages all the game functionality contains instances of other classes that make the game go:
That's a high level survey of what makes Gravity Monkey go. There is a pretty liberal use of objects, and I haven't had to do a high degree of optimization for performance reasons. Of course, there are limits to the total numbers of things: only one rock flying at a time, only a dozen bananas or so in the air, a total of six possible birds in the flock -- but beyond those limits, I'm quite impressed with the way Java performs on the Motorola phones. It's just as reliable as initial web browser support of Java 1.0 back in 1995/96, and seemingly a much better performer than the KVM classes released for the Palm OS (I have no facts to back up the claims, of course, just what I remember of performance and stability).
If you want greater detail to the UML diagram, then check out the diagram below. This includes attributes per class, and gives you a slightly greater chance of figuring out how it all fits together.
If this much data doesn't satisfy your curiousity (after all, what good monkey isn't curious), please let us know, and we'll try to answer your questions. At this point there are no plans to release the source code for Gravity Monkey ™, but if there is sufficient support for GMonk and other planned releases, then a source release is certainly plausible -- the goal isn't to protect any proprietary code: we just want to keep our Easter Eggs hidden from plain site. |