Okay, that does indeed work when I spawn the event at onLevelLoad. I can't make the enemy spawn it, however, though on paper this looks like it should work:
Code:
void onLevelLoad() {
jjObjectPresets[OBJECT::BEE].behavior = testBee;
}
void testBee(jjOBJ@ bee) {
int freeze;
bee.behave(BEHAVIOR::BEE);
if (bee.state == STATE::START) {
freeze = jjAddObject(192, 50, 50, 0, CREATOR::OBJECT);
}
if (bee.state == STATE::FLY) {
jjObjects[freeze].xPos = bee.xPos;
jjObjects[freeze].yPos = bee.yPos;
}
if (bee.state == STATE::KILL) {
jjObjects[freeze].state = STATE::KILL;
}
}
|