Training and Consulting | ||
| Home |
| Current Page - 00 - Introduction | Next Page - The First Window | |
| Return to the index of free Java tutorials |
Introduction (c) Alexander Hristov The purpose of this tutorial is to show how it's possible to develop a simple java game with a more than adequate performance. We'll make use of some new features introduced in the JDK 1.4 such as built-in support for double buffering, and some others. These techniques are not usually taught in the standard courses or books about Java programming. Instead of the traditional system of showing a completed source code and then explaining it, I prefer following a different approach, which IMHO is better for teaching, and which mirrors more closely the process that programmers usually follow when developing programs : We'll develop the game in little steps, each step adding some small feature on top on the previous steps, and explaining, in each step, what was done, and why it was done that way. I believe this helps make the design decisions more clear, and yields a better understanding of the source code as a whole.
However, understand that developing this game didn't happen in a "straight
line", from the initial line of code to the last, without any changes in
between; that sort of thing is extremely rare. When a programmer is
developing a program, he makes mistakes, comes up with better ways of
doing things, refactors source code, reorganizes responsibilities, new
requirements appear, etc. Because of the reality of developing software,
it would be unfair to start with a polished program and then develop it
step by step as if, from the very beginning, we had a clear view of the
result.
I recommend that you follow this philosophy when you develop your programs. Once you've made your initial analisys and modelling (which I won't cover in this tutorial), it is very useful to have as soon as possible something "that works". Don't wait to have 200.000 lines of code before pressing the "Run" key for the first time to see if the your huge codeball makes any sense. Having something that is already working provides a steady foundation on which to fall back if some changes that you just added break everything. If you don't have a source-control system that keeps old versions of files, use the poorman's approach I've used here : create separate packages for each version. With IDEs such as Eclipse,copying and moving classes between packages is a breeze
The aim of this Java tutorial will be to develop a "Space Invaders" type
of game, meaning : monsters coming from above, player below, and "shoot
everything that moves" gameplay.
Finally, I would like to emphasize that this is not a Java Tutorial, but a
tutorial specifically aimed at building games using the built-in features
of Java. Maybe I'll write some other tutorials covering JOGL or LWJGL, but
for now, this is it.
|
Do you want to be notified when new tutorials or lessons are published? Press here
| Current Page - 00 - Introduction | Next Page - The First Window | |
| Return to the index of free Java tutorials |
(c) 2004 Planetalia S.L. All rights reserved. Unauthorized reproduction and/or mirroring is not permitted