View Single Post
Violet CLM Violet CLM's Avatar

JCF Éminence Grise

Joined: Mar 2001

Posts: 10,978

Violet CLM has disabled reputation

Mar 12, 2020, 05:55 PM
Violet CLM is offline
Reply With Quote
First off, you could simplify all that like this:
Code:
void onLevelLoad() {
	jjObjectPresets[OBJECT::LIZARD].determineCurAnim(ANIM::FROG, jjIsTSF ? 12 : 11);
}
You're running into the problem that BEHAVIOR::WALKINGENEMY is one of the only parts of the game that cares about jjANIMFRAME::coldSpotY, but the frog sprites are one of the only land-based animations that don't have that property defined. Walking enemies try to align their hotSpotY point to the surface of the ground they're on, but that number defaults to 0, which is the top of the sprite. Just move it upwards until it looks better:
Code:
	jjANIMATION@ frogWalkAnim = jjAnimations[jjObjectPresets[OBJECT::LIZARD].curAnim];
	for (uint i = 0; i < frogWalkAnim.frameCount; ++i)
		jjAnimFrames[frogWalkAnim.firstFrame + i].coldSpotY = -25;
__________________