Game Development Reference
In-Depth Information
C H A P T E R 6
■ ■ ■
3D Shooters Episode I:
Wolfenstein 3D for Android
The next two chapters are my personal favorites and the most exciting of this topic. We start by looking
at the real thing: Wolfenstein 3D (also referred to as Wolf 3D), the godfather of all 3D shooters. The main
goal of this chapter is to show you how easy is to bring Wolf 3D from the PC to the Android device, but
also in this chapter, you will learn how to do the following:
Maximize code reuse by compiling high-performance native code in a dynamic
shared library.
Write JNI code to connect Java and C subroutines.
Cascade graphics back and forth the native and Java layers.
Handle sound requests sent by the native layer with the Android media player.
Build the Android project and test in the emulator.
Let's get started.
Gathering Your Tools
Some Java developers simply dismiss other languages, especially procedural languages like C. I believe
that you should embrace the elegant object oriented features of Java and the raw power of C and there is
nothing you cannot do in the gaming world.
Before we start, you will need to acquire the things explained in this section to make the most of this
chapter.
Downloading the Chapter Source Code
My 1.210goal in here is to create a balance between the object-oriented features of the Java language and
the power of C. Thus I have provided not only the Java source but the C code, neatly organized in this
chapter source code. You should import the project to workspace as you move along this chapter. Some
of the listings have been stripped for simplicity. To import the chapter source to your Eclipse workspace,
follow these steps:
Search WWH ::




Custom Search