Support classes
The following are generally useful classes that might
be used in more than one scenario. They were ussually developed in the
context of a specific scenario, but should be useful in other contexts,
possibly with a little modification. By publishing the classes here, implicit
permission is granted for you to use these classes in your projects,
modify and distribute them. You should not, however, remove the original
author name. If you modify a class, add your own name as an additional
author (with explanation of the modifications made, if you want), but
acknowledge original authors.
You may also want to look at the
support class collection on the gallery. It has a number of support
classes within scenarios submitted by the community, and also provides
a means of uploading any of your own support classes you want to share.
| Class |
Decription |
Sample uses |
| AnimatedActor |
A class that allows an actor to have an animated image. |
Animation |
| Counter |
A counter that displays a number value with a text
prefix. Can be used for points scores, or similar. |
ants
MiksAsteroids
|
| Explosion |
An explosion. This is an actor class. Also requires explosion.png (put
into images) and Explosion.wav (put
into sounds). |
Lunar-lander
Asteroids |
| FPS |
Displays the approximate frames per second of a scenario. Useful
for measuring performance changes. |
Demo
3D Space Shooter
|
| GifActor |
A class that allows an actor to have an animated image from a GIF file. |
Demo |
| MidiPlayer |
Plays MIDI files and generates notes through MIDI. |
Demo
MIDI Piano
|
|
A class that adds relative 'move' and 'turn' methods
to actors. It is a subclass of Actor (to be used as superclasses
for your own actors).
|
|
| Plotter |
A class that implements a graph that plots the population
of two actor classes. |
foxes-and-rabbits |
| Rotator |
A class that easily lets you rotate around a given point in the world. |
Demo
Analogue Clock
|
| Slider |
A graphical slider that can be used to select a range of values. |
Demo
Warbugs
|
| SmoothMover |
A class that adds smoother movement for fast-moving,
high-resolution worlds (such as typical arcade games) This class
replaces the int-based location with double-based location fields.
It is a subclass of Actor, and can be used as superclass for specific
actors. Requires class Vector. |
Asteroids |
| Vector |
A class representing a two-dimensional vector. This
can be used to represent and modify movement of actors. |
Asteroids |
| Wanderer |
A class that allows actors to wander in and out of the world,
whilst still keeping track of their co-ordinates. |
Demo
Target
|
|