Great, it works! I don't really need #3 since this is going to be a boss fight, so the gem ring spawn point will always be nearby. Right now the last thing I'm trying to figure out is creating a new hourglass shield a while after the current one is destroyed by touching it. I can't really find what's wrong in the code, but for some reason it makes the bee create new rings regardless if it already has one or not:
Code:
void testBee(jjOBJ@ bee) {
if (bee.state == STATE::START || bee.counter == 255) {
bee.counter = 0;
bee.special = jjAddObject(192, 50, 50, 0, CREATOR::OBJECT);
}
bee.behave(BEHAVIOR::BEE);
if (bee.state == STATE::ATTACK || bee.state == STATE::FLY || bee.state == STATE::IDLE) {
jjObjects[bee.special].xPos = bee.xPos;
jjObjects[bee.special].yPos = bee.yPos;
if (jjObjects[bee.special].state == STATE::KILL) {
bee.counter++;
}
}
if (bee.state == STATE::KILL) {
jjObjects[bee.special].behavior = BEHAVIOR::EXPLOSION2;
}
}
|