Free Java
December 27, 1999
Most of the free interactive games on the web are
Java -- based,
while a few others use technologies such as
Shockwave or
Perl and
CGI.
Presumably Java is so popular because it's an evolution of classical
languages such as C and C++,
and so there was a large pool of programmers able to learn Java quickly,
and for whom programming interactive games was a good way to test their
skills and have fun at the same time.
Downloading and installing Java games is almost always a very simple
and easy process.
There's usually a link to a zipped file (possibly compressed also).
Get the file over to your server
(see Part 1 for
instructions
if you need them) and unzip it in the directory where you want it.
As a matter of good file management practice,
I recommend you create a new directory specifically for it,
as there might be several files.
The only other thing you need to do (apart from fleshing out the page,
e.g. with user instructions to play the game) is to download the
"class" file into the same directory as the page itself.
There'll often be an HTML page included in the downloaded zip file
that has everything you need, e.g. applet tag and instructions to play.
Sometimes you are encouraged to use it as is,
but usually you'll want to modify it,
for example to suit the style of your site.
As a matter of courtesy
(and probably to fulfill the requirements of usage),
make sure to include a credit with link back to the author.
When you link to your new game,
you might want to note any browser requirements,
e.g. Java version supported.
Not only are there Java applets for games and puzzles,
but also for many other applications, such as site navigation,
education, network utilities, and various effects with text and sound.
Adding Java applets to a web page is really very simple!
Moiré pattern.
You can start and restart the applet by shift-clicking on the pattern.
You can also click-and-drag to control the motion of the pattern yourself.
Here's an example of the code you need to put on your page:
<applet code="Moire1.class" height="200" width="200">
<param name="bgColor" value="white" >
<param name="lineColor" value="0 180 0" >
</applet>
The
applet tag
specifies where the Java code is, and how much screen to allocate for it.
The code attribute gives the name of the file. If it's not in the
same directory as the HTML file you're embedding it in, then you'll
need to use the codebase attribute to specify the URL of the directory
it's in.
The content of the applet tag (i.e. stuff between the opening and
closing tags) is a set of parameters, if any, and also optionally,
any alternative HTML in case the user's browser doesn't support Java
(e.g. a screenshot of what the applet looks like).
For more detailed instructions, in case you need them,
Mike Hall has an excellent
short tutorial.
Sources for Java Games and Puzzles
Here are some places where you can find some Java games applets.
Virtually all of the applets described below came from one of these
sources, and I highly recommend them all!
Particular mention should be made of the authors who put in a lot of
work, create amazingly professional products,
and give it away for free.
Thanks especially to Karl Hörnell, and Mike Hall!
How To Build a Web Site with Free Stuff
How To Build a Web Site with Free Stuff Table of Contents
Free Games
|