#
# Timer code for monster 1
#

Object	obj = getThisObject();
int	pos = getObjectVar(obj, 0);
int	inter = 300;

if (getLevel() < 5)
	inter = 700;

setObjectYMovement(obj, sin(itof(pos)*0.02)*0.3);

setObjectVar(obj, 0, pos + 15);

if (pos % inter == 0)
{
	int	objx = getObjectXPosition(obj);
	int	herox = getObjectXPosition(getHero());
	if (absi(objx - herox) < 20)
	{
		Object	green = createObject(makeCode("grn1"), objx + 10,
			getObjectYPosition(obj)+30);
		createMotionController(green);
		setObjectGravity(green, 0.2);
		playSample(makeCode("fart"));
	}
}

