#
# Collision event handler for "candy"
#

Object	obj = getThisObject();
Object	other = getOtherObject();

if (other == getHero())
{
	float	a = 0.0;
	int	x = getObjectXPosition(obj) + 16;
	int	y = getObjectYPosition(obj) + 16;
	while (a < 360.0)
	{
		createParticleObject(makeCode("par2"), x, y, a, 3.0, 20);
		a = a + 40.0;
	}

	destroyObject(obj);
	
	playSample(makeCode("food"));
	
	decCandyCount();
}

