/** CollisionHandler is just two methods that are called by SpriteWorld when sprites collide with walls or with each other. It could be implemented by a sublclass of SpriteWorld or even the main Applet... wherever you want to put the responsibility for changing sprites' directions, speeds, or killing them altogether. */ public interface CollisionHandler { final static byte NORTH=1; final static byte SOUTH=2; final static byte EAST=4; final static byte WEST=8; final static byte ALLFLAGS=15; /** Interface to handle collision between one HardlySprite and one or more sides of the Component */ void collision (HardlySprite sprite1, byte flags); /** Interface to handle collision between two HardlySprites. @return true if both sprites "survive" the collision, false if one or both do not. What this really means is that false tells the SpriteWorld to break out of its collision detecting loop for sprite1. (Don't worry about sprite2 -- if you killed it, it'll be gone from SpriteWorld's vector by the time the loop gets there) */ boolean collision (HardlySprite sprite1, HardlySprite sprite2); }