View Single Post
DoubleGJ DoubleGJ's Avatar

JCF Member

Joined: Sep 2002

Posts: 3,049

DoubleGJ has disabled reputation

Aug 16, 2017, 04:07 AM
DoubleGJ is offline
Reply With Quote
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;
	}
}
__________________
"So unless I overwrote my heart with yours, I think not. But I might have." - Violet CLM

Two Games Joined releases:
Control / Splinter (twin singles)
|| Ballistic Bunny (EP)
||
Beyond (maxi-single)
|| Beyond: Remixed (remix EP)
|| Inner Monsters OST (mini-album)
||
Shadows (album)