Downloads containing xlmhmk.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Anniversary Bash 18 Levels Jazz2Online Multiple N/A Download file
JJ2+ Only: Hall of The Mountain KingFeatured Download Superjazz Capture the flag 8.4 Download file

File preview

void onLevelLoad() {
	jjObjectPresets[OBJECT::PINKPLATFORM].behavior = Lift;
	jjObjectPresets[OBJECT::PINKPLATFORM].bulletHandling = HANDLING::IGNOREBULLET;
	jjObjectPresets[OBJECT::PINKPLATFORM].isFreezable = false;
	jjObjectPresets[OBJECT::PINKPLATFORM].deactivates = false;
	jjObjectPresets[OBJECT::PINKPLATFORM].state = STATE::WAIT;
	
	jjObjectPresets[OBJECT::BOUNCERAMMO15].behavior = Egg;
	jjObjectPresets[OBJECT::RFAMMO15].behavior = Egg;
	jjObjectPresets[OBJECT::TOASTERAMMO15].behavior = Egg;
}

void onDrawLayer4(jjPLAYER@ play, jjCANVAS@ canvas) {
	canvas.drawTile(49*32, 8*32, 419);
	canvas.drawTile(50*32, 8*32, 419);
	
	for (int i = 9; i < 30; i++) {
		canvas.drawTile(49*32, i*32, 418);
		canvas.drawTile(50*32, i*32, 418);
	}
}

void Lift(jjOBJ@ obj) {
	switch (obj.state) {
		case STATE::WAIT:
			obj.xPos = obj.xOrg + 16;
			break;
		case STATE::FADEIN:
			if (obj.yPos > 9*32) obj.yPos = obj.yPos - 6;
			break;
		case STATE::FADEOUT:
			if (obj.yPos < 25*32) obj.yPos = obj.yPos + 6;
			else obj.state = STATE::WAIT;
			break;
		case STATE::DEACTIVATE:
			obj.deactivate();
			return;
	}
	obj.bePlatform(obj.xPos - 12, obj.yPos, 80, 16);
	
	jjDrawTile(obj.xPos - 32, obj.yPos, 710);
	jjDrawTile(obj.xPos, obj.yPos, 710);
}

void Egg(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::AMMO15, false);
	
	switch (obj.eventID) {
		case OBJECT::BOUNCERAMMO15:
			jjDrawTile(int(obj.xPos) - 32, int(obj.yPos) - 20, 334);
			jjDrawTile(int(obj.xPos), int(obj.yPos) - 20, 335);
			jjDrawSprite(obj.xPos - 1, obj.yPos, ANIM::AMMO, 25, 0, 0, SPRITE::BRIGHTNESS, 64);
			break;
		case OBJECT::TOASTERAMMO15:
			jjDrawTile(int(obj.xPos) - 32, int(obj.yPos) - 14, 334);
			jjDrawTile(int(obj.xPos), int(obj.yPos) - 14, 335);
			jjDrawSprite(obj.xPos, obj.yPos + 6, ANIM::AMMO, 57, 0, 0, SPRITE::BRIGHTNESS, 64);
			break;
	}
}

void onPlayer(jjPLAYER@ play) {
	if (play.platform != 0) {
		jjOBJ@ obj = jjObjects[play.platform];
		
		if (obj.eventID == OBJECT::PINKPLATFORM && obj.state == STATE::WAIT) {
			obj.state = STATE::FADEIN;
		}
	}
	else if (play.platform == 0) {
		for (int i = 0; i < jjObjectCount; i++) {
			jjOBJ@ obj = jjObjects[i];
		
			if (obj.eventID == OBJECT::PINKPLATFORM && obj.state == STATE::FADEIN) {
				obj.state = STATE::FADEOUT;
			}
		}
	}
}