Tuesday, 30 December 2008

The Zilch sprite

Zilch is a sprite which is invisible and only serves to detect hits in the part of a scene in which it has been placed. There is an example of this in the original game where the keyhole of the door is covered by a Zilch to enable the audio clip when the gold key hits the keyhole.

public class Zilch extends Sprite
{
public Zilch(String spriteName, String Scenename)
{
super(spriteName, Scenename, "zilch.gif", SINGLE,
1, UNMOVING, NOACTION);
setSize(50,50);
}
}

No comments: