Java Reference
In-Depth Information
These concepts were all born in the PC game development industry
over the last few decades and are still relevant to mobile games today.
The core theme is always to get away with as much as you can without
decreasing the user experience.
TIP : Do not draw what cannot be seen and cheat as much as you can!
The world of mobile game development is specialized and extremely
interesting. If you want to know more about general games concepts,
please refer to three excellent topics: [Stichbury 2008] is dedicated
purely to games development on Symbian OS and is an excellent read.
[Astle and Durnil 2004] and [Malizia 2006] focus on 3D graphics while
exploring a wide range of topics in mobile games development and are
highly recommended if you are serious about learning more.
8.2 Building a Simple MIDP Game
Now that's all great, but let's face facts - writing and playing games are
the fun bits. However before we get into the advanced stuff let's pretend
that all we have is Java ME without the frills and see what we can do. The
point to be demonstrated here is that the MIDP Game API was developed
for the feature phone market. In this market, there are limits on heap size,
thread pools, JAR size, few or no optional JSRs and minimal multimedia
capabilities. Given all of that it is amazing what can be done in a very
short space of time. So let's hook straight in with a simple game that we
can throw away just as a quick demonstration of how much the MIDP
2.0 Game API does for you.
Figure 8.2 shows a screen shot for a demo game, called GhostPong in
honor of the original arcade game Pong. 6 It's less than 150 lines in length
and took just over an hour to write (it should have taken less but I kept
making stupid typing mistakes
).
The point of the game is that basically the little ghost sprites fall from
the top of the screen and you have to smash them out of existence with
the brick paddle at the bottom which moves left and right. You get 10
points for each one you get and you lose 10 points for each ghost you
miss. And as for the name - well there's no excuse for that.
What this shows is that you don't need complex architectures and
reusable libraries in order to build effective games. With MIDP 2.0 and
the Game API you can jump straight in and just get on with it. The
game is only 6 KB in size and has no external requirements other than a
dependency on MIDP 2.0. This means that it would quite possibly run
today on almost a billion mobile phones.
...
6 en.wikipedia.org/wiki/Pong
Search WWH ::




Custom Search