About Warp
How to play
This part is so simple it doesn't really warrant any explanation. Shoot at
everything that moves and some of the things that don't. You'll soon learn
which objects can be blown up and which ones just absorb the blasts. Avoid
flying into anything that looks bulky and sticks out of the ground.
Keep in mind that most Java-enabled browsers require that the cursor is
located within the current applet area for the keyboard input to be directed
to the applet. Some may even insist on an initial mouse click.
How to cheat
I didn't spend weeks preparing the graphics of Warp just to have them gather
dust because most people are too lousy players to get any further
than level one. You can start any of the first five levels by pressing the
SHIFT key plus A, B, C, D or E.
Platform-specific problems
On certain machines with slow graphics cards but fast processors, the
"curtain" effect between levels and when losing a life will not look right.
It will appear to take only two or three steps before the screen goes blank.
This is because the main loop has a period of no less than 70 milliseconds
and the computer can't redraw the screen that often, so it will simply
ignore the update request and wait for the next one ... or the next after that.
However, during actual play, the loop has a lot more to do and will usually
be delayed for so many extra milliseconds that the computer does
have time to carry out the updates.
Technical stuff
Although each level is more than ten screens long (and can be made any size)
the graphics area that stores the background is in fact just a little over
two screens. Think of the current view as a window that moves upward along the
graphics area. New ground is continuously being drawn above the window. At the
same time an exact replica is drawn below it, so that when the window
reaches the top of the graphics area it can jump down to the bottom and
continue seamlessly from there. The cost of this on-the-fly graphics updating
is (at most) one Graphics.drawImage
operation per animation cycle
and it saves a tremendous amount of memory.
Another memory-saving strategy I've used in Warp is to load the graphics of
each new level separately and throw them away when they are no longer
needed. This dramatically cuts down on the number of Image
objects
the applet needs to allocate and of course reduces the download time for
netsurfers who weren't going to play all nine levels anyway. (I was actually
forced to do this because the game would have been too big to run on
my humble Macintosh Performa 6200 otherwise.)
To make the scrolling as smooth as possible, I don't update the score display
and the blasted stationary objects immediately, but wait until the
graphics updating has a spare cycle. I'm not sure exactly how much effect this
has, but on slow machines I suppose every little bit helps.
Ingredients
Warp needs ten graphics files - one for each level and one that holds the
parts that make up the control panel and the things that remain constant at
each level, like explosions. They are named warp0.gif
through
warp9.gif
and can be found in the current directory. The game
also needs sounds. KA-PEOOO!, CRASH! and BING! come
in individual audio files named warpsnd0.au
, etc.
Source code
This is what the code looks like.
Back to the game.