[Home]
The Basketball Applet
BBApplet
Download
The basketball applet is provided as shareware. You can download BBApplet.zip,
put it on a local HTML-page and play it as long as you want. If you want
to put it on any of your homepages which is accessible from the WWW you
have to:
- Send me as much money as you think you want to give. Please send cash
only. I will accept any currencies but Deutschmarks and American Dollars
are preffered. Send it to:
Piet Jonas
Franz-Mehring-Straße 20
17489 Greifswald
Germany
- Give me the credit and provide a link to my homepage
(http://www.physik.uni-greifswald.de/~jonas) on the page where you put
the applet.
- Write me an e-mail with your name, address and the address of the page
where you put the applet.
Download BBApplet.zip
It contains:
BBApplet.class, BBall.class, Basket.class
|
- |
the Java class files |
|
- |
the bitmap of the ball |
|
- |
the bitmaps of the basket (for left and right side) |
|
- |
the bitmap of the speaker |
|
- |
the documentation |
|
- |
here you can play |
|
- |
the background bitmap for Test.html |
|
- |
the sound of the bouncing ball |
|
- |
the sound of the ball touching the basket |
|
- |
the sound, when the ball hits |
Put the Applet on your HTML-Page
This is a part of the source of Test.html:
...
<APPLET code=BBApplet.class width=500 height=400>
<PARAM name="background" value="255 255 255">
<PARAM name="standardtext" value="Game mode">
<PARAM name="hittext" value="Yes!">
<PARAM name="cheattext" value="Uhhh, you cheated">
<PARAM name="atempttext" value="Hit(s) Shot(s)">
<PARAM name="loadtext" value="Wait, loading images...">
<PARAM name="mode" value="1">
<PARAM name=backimage value="background.gif">
Your browser don't support Java, so see this screenshot at least:
<P>
<IMG SRC="screenshot.gif" HEIGHT=467 WIDTH=408>
</APPLET>
...
You can adjust the appearance of the applet with a lot of parameters.
Here is a table with all possible parameters:
parameter |
value |
default
(when you don't provide that parameter) |
background |
the background color as:
<red> <green> <blue>
|
255 255 255 |
backimage |
URL of the GIF or JPEG file, which
will be shown in the background
(Attention, can slow down the applet
significantly) |
none |
sound |
on - each bounce of the ball is
accompanied by a sound
off - no sound
|
off |
hitmode |
0 - demo mode
1 - game mode
2 - link mode
3 - two player mode |
0,
2, if the "link" parameter is provided |
link |
URL with the location, where the
browser will switch to, when you
hit in link mode. |
no default |
standardtext |
the text which will normaly be displayed |
"" |
hittext |
the text which will be displayed when
your shot hit |
"Click ball to go on!" |
cheattext |
the text which will be displayed when
you tried to cheat |
"You cheated, try again!" |
atempttext |
the words that indicate your shots and
your hits (separated by a blank) in
game mode
<hits> <shots>
|
"Hits Shots" |
loadtext |
the text that will be displayed when the
applet is waiting for th images to be
loaded |
"Loading Images" |
Additionally you can customize the applet by providing new images for
the ball, the basket, etc. and new sounds.
How to play
Basics
The goal of this game is to shoot the ball into the basket. To shoot
you have to leftclick inside the ball and drag the mouse. You will see
a line from the middle of the ball to the mouse pointer. When you leave
the mouse button, the ball will start moving in the direction of the line.
The length of the line indicates the starting velocity. The ball bounces
back from the left, the right and the bottom wall and from the ring of
the basket. There is no ceiling. When you manage to shoot the ball into
the basket, the ball stays there. Click somewhere inside the applet to
go on. What happens depends on the mode of the applet.
Cheating
You can move the ball by right clicking it and dragging the mouse. But
dragging the ball into the basket is not allowed.
Sound
Clicking the speaker icon toggles the sound on and off.
Modes
The applet has four different modes, demo mode,
game mode, link mode and two
player mode.
Demo mode
In demo mode you can train your shootings. Clicking somewhere after
shooting the ball into the basket, let the ball simple fall down. See the
example below:
Game mode
In game mode your shots and your hits will be count. Clicking somewhere
after shooting the ball into the basket, puts the ball somewhere on the
floor. See the example.
Link mode
In link mode you can enter a new location by shooting the ball into
the basket. Clicking somewhere after shooting the ball into the basket,
let the browser switch to the specified link. See
the example
on my homepage.
Two player mode
In two player mode there are to baskets. The hits for each basket will
be count independently. Clicking after shooting the ball into the basket,
puts the ball somewhere on the floor. See the example.
[Home]
Piet Jonas
, 15.07.1997