Site search


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.

Class Decription Sample uses

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).

 
Vector A class representing a two-dimensional vector. This can be used to represent and modify movement of actors. Asteroids
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
Plotter A class that implements a graph that plots the population of two actor classes. foxes-and-rabbits
Explosion An explosion. This is an actor class. Also requires explosion.png (put into images) and Explosion.wav (put into sounds). Lunar-lander
Asteroids
Counter A counter that displays a number value with a text prefix. Can be used for points scores, or similar.

ants
MiksAsteroids

AnimatedActor A class that allows an actor to have an animated image. Animation

 

 


maintained by Poul Henriksen and Michael Kölling.