Game Development Reference
In-Depth Information
To test this project I used the following mobile device:
Samsung Galaxy Tab 3 10.1 P5220:
CPU Dual-core 1.6 GHz
GPU PowerVR SGX544MP2
Card slot microSD: 32 GB
Internal RAM: 32 GB
Summary
Congratulations! You have seen how easy it is to bring one of the first PC shooters to
Android using a mix of Java and the original C engine. You've evaluated the complexity of
the game and considered the best way to implement it. This chapter covered the following
topics:
The game architecture, where Java activities and UI XML layouts are glued with C subroutines
using JNI native methods and C to Java callbacks.
The main activity, which is the Java class that controls the life cycle of the application, along
with a UI layout.
User interface handlers, such as menus, keys, and touch event handlers, plus native
callback handlers for graphics initialization, video buffer updates, fatal errors, and audio
requests
You've also looked at custom touch screen controls for phones that do not have a keyboard.
You've seen that the native interface class has callback listeners for clients that wish to
receive C to Java callbacks, native methods invoked through JNI to start the game loop and
send key and motion event information to the Native library, and C to Java callbacks used to
delegate engine messages to the listener activity.
You've looked at the native layer that glues together the Java and C code and provides the
native method implementations. Changes to the original code are also required to remove
invalid dependencies and insert the C to Java callbacks. Finally, you've seen the Makefile
required to compile the Native library and the IDE launch configuration to test the game in
the emulator.
Using the Java/C power combo, you have brought one of the great and highly popular PC
games, Doom, to the platform. Even though Google is pushing for Java-only development
and provides little or no support for native development, Java alone is not the best choice
when it comes to advanced mobile gaming. Java-only code works fine for the regular mobile
app, but it is not enough for high-performance graphics.
 
Search WWH ::




Custom Search