Andreas Rozek Hints for Reading List of Recent Changes Guestbook Entry Contact the Author  Deutsche Version  HomePage Previous Topic Next Topic  First Page of Current Topic Next Page Previous Page

Squash

This page refers to an experiment which tests if the "PixelGraphics" package may also be used for a simple JavaScript game with "live" (animated) graphics within a HTML document.

While this page may be risklessly displayed with any browser and even on computer systems with only moderate processor and memory capacity, visiting the actual Squash page may occupy your computer for several dozens of seconds and - probably - crash browser and/or operating system! (The author recommends Opera 5.12 (or newer) for a good performance!)

If you want to learn more about the underlying JavaScript pixel graphics package, you should also visit the "PixelGraphics" page (following this link is safe).

Please, also consider my "Hints for Reading" and the "List of Recent Changes".

Overview

The figure on the left shows a (static) snapshot of the "Squash" demo: a small ball (represented by a single pixel) moves around within an area of 60x45 pixels, surrounded by reflecting borders to the left, the top and to the right. The lower edge is "open", and the ball will leave the playfield (thus terminating the game) unless a horizontally moveable "racket" hits the ball and reflects it back into the playfield again.

As you may already imagine, the goal of the game is to keep the ball within the playfield as long as possible. The actual number of successful reflections (i.e., "racket hits") is shown and a "top four" ranking lists the most successful games since the HTML page has been opened (the list is cleared as soon as the page gets closed by the browser).

The user may chose a "skill level" (which defines ball speed and racket width), start/stop the game and move the racket.

If you are aware of the potential problems for your system, you may proceed to the actual game.

Source Code

The source code of this game is available for download:

You will also need some image files from the "PixelGraphics" package:

Disclaimer

Please, consider also the author's Disclaimer!

http://www.Andreas-Rozek.de/JavaScript/Libraries/Squash/index.html    (last Modification: 09.05.2002)