1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#
# 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"));
}
}
|