View Single Post
chandie

JCF Member

Joined: Jan 1970

Posts: 19

chandie has disabled reputation

Jan 29, 2020, 03:41 AM
chandie is offline
Reply With Quote
Thumbs up JJNxt for the end boss

Quote:
Originally Posted by Seren View Post
A boss health bar is drawn for players if their bossActivated is true and boss refers to an object by its ID. There's also an accompanying activateBoss method, or you could use the traditional Activate Boss event. See especially the documentation for boss, as it describes how the health bar's size is determined.
Quote:
Originally Posted by Violet CLM View Post
One possible additional consideration is your boss.energy==0 condition. Several weapons do more than 1 damage, so it's easy for an enemy to end up with a negative energy number instead of exactly 0. (Some standard enemies/bosses check for this and immediately set energy to 0, others set it to -1, and probably others don't do anything at all.)
Thank you for the advices. I've managed to make the boss work. However the script stops working when I try to end the level automatically. I think what I've been doing wrong is not to figure where to implement the jjNXT. Here's my code. I've tried to create a JJ1 Turtle Goon Boss, like the one in Diamondus Secret.

Code:
#include "Jazz1Enemies v05.asc"
#include "Resize v11.asc"
#include "TrueColor v13.asc"
bool Boss=false; 

void onLevelLoad() {
	Jazz1::MakeEnemy(OBJECT::NORMTURTLE, Jazz1::Enemies::Diamondus_TurtleGoon, true);
	jjObjectPresets[OBJECT::NORMTURTLE].behavior = NORMTURTBOSS;
	jjObjectPresets[OBJECT::NORMTURTLE].energy = 100;
	jjObjectPresets[OBJECT::NORMTURTLE].points = 200;
	}

void onFunction0(jjPLAYER@ play) {
		Boss=true;
play.boss=jjAddObject(OBJECT::NORMTURTLE, 37*32, 54*32);
	}

void NORMTURTBOSS(jjOBJ@ boss) {
		jjPLAYER@ play = jjLocalPlayers[0];
	if (boss.energy==0&&++boss.counter>2300)  
			jjNxt(bool warp = false, bool fast = false);
	}