15.07.97
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:
Piet Jonas
Franz-Mehring-Straße 20
17489 Greifswald
Germany
Download BBApplet.zip
It contains:
BBApplet.class, BBall.class, Basket.class |
- | the Java class files |
baskball.gif |
- | the bitmap of the ball |
basketl.gif, basketr.gif |
- | the bitmaps of the basket (for left and right side) |
spkon.gif |
- | the bitmap of the speaker |
BBApplet.html |
- | the documentation |
Test.html |
- | here you can play |
background.gif |
- | the background bitmap for Test.html |
bounce.au |
- | the sound of the bouncing ball |
basket.au |
- | the sound of the ball touching the basket |
hit.au |
- | the sound, when the ball hits |
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.
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.
You can move the ball by right clicking it and dragging the mouse. But dragging the ball into the basket is not allowed.
Clicking the speaker icon toggles the sound on and off.
The applet has four different modes, demo mode, game mode, link mode and two player 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:
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.
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.
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.