Downloads containing jungletown.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: The Town Pack Slaz Single player 7.7 Download file

File preview

const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
#include "MLLE-Include-1.6.asc" ///@MLLE-Generated
#pragma require "jungletown-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "jungletown.j2l" ///@MLLE-Generated

int blasterOption = 0;
enum blasterOptionEnum {simple, advanced};

class NonFood : jjBEHAVIORINTERFACE {
	void onBehave(jjOBJ@ obj) {
		obj.behave(BEHAVIOR::PICKUP);
	}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@, jjPLAYER@ play, int) {
		obj.behavior = BEHAVIOR::EXPLOSION2;
		obj.scriptedCollisions = false;
		obj.frameID = 0;
		jjSample(obj.xPos, obj.yPos, SOUND::COMMON_EAT1, 0, 0);
		return true;
	}
}

void onLevelLoad() {
	jjTexturedBGFadePositionY = 0.10;
	jjUseLayer8Speeds = true;
	jjWeapons[WEAPON::BLASTER].infinite = false;
	jjWeapons[WEAPON::BLASTER].maximum = 0;
	blasterOption = simple;
	jjObjectPresets[OBJECT::APPLE].determineCurAnim(ANIM::AMMO,15);
	jjObjectPresets[OBJECT::FASTFEET].determineCurAnim(ANIM::PICKUPS,2);
	jjObjectPresets[OBJECT::FASTFEET].points = 50;
	jjObjectPresets[OBJECT::FASTFEET].scriptedCollisions = true;
	jjObjectPresets[OBJECT::FASTFEET].behavior = NonFood();
	jjObjectPresets[OBJECT::EXTRATIME].determineCurAnim(ANIM::PICKUPS,77);
	jjObjectPresets[OBJECT::EXTRATIME].points = 50;
	jjObjectPresets[OBJECT::EXTRATIME].scriptedCollisions = true;
	jjObjectPresets[OBJECT::EXTRATIME].behavior = NonFood();
	jjObjectPresets[OBJECT::STANDMONKEY].energy = 1;
	jjObjectPresets[OBJECT::MONKEY].energy = 1;
	
	jjPIXELMAP rain(32,32);
	for (uint x = 0; x < rain.width; ++x) {
		for (uint y = 0; y < rain.height; ++y) {
		if (x == 16) {
				if (y <= 24) rain[x,y] = 75;
				else rain[x,y] = 74;
			} else {
				rain[x,y] = 0;
			}
		}
	}
	
	jjANIMATION@ anim = jjAnimations[jjAnimSets[ANIM::COMMON].firstAnim + 2];
	for (uint frameID = 0; frameID < anim.frameCount; ++frameID) {
		jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame + frameID];
		rain.save(frame);
		frame.hotSpotX = -frame.width/2;
		frame.hotSpotY = -frame.height;
	}
}

void onLevelReload() {
	jjWeapons[WEAPON::BLASTER].maximum = 0;
}

void onMain() {
	jjWeapons[WEAPON::BLASTER].maximum = 1;
}

void onPlayer(jjPLAYER@ play) {
	if (play.ammo[WEAPON::BLASTER] != jjWeapons[WEAPON::BLASTER].maximum) {
		if (play.food == 1) play.ammo[WEAPON::BLASTER] = play.ammo[WEAPON::BLASTER] + 1;
		play.food = 0;
		}
	if (play.food >= 1) {
		play.food = 0;
		}
	
	for (int i = 0; i < 1024; i++) {
		jjPARTICLE@ particle = jjParticles[i];
		if (particle.type == PARTICLE::RAIN) {
			particle.xSpeed = 0;
			particle.ySpeed = play.ySpeed < 0? 10 : int(10 + play.ySpeed);
		}
	}
}

int hudWidth = jjSubscreenWidth-20;

bool onDrawAmmo(jjPLAYER@ play, jjCANVAS@ canvas) {
	if (play.currWeapon == WEAPON::BLASTER && blasterOption == advanced) {
	if (play.charCurr == CHAR::SPAZ || play.charCurr == CHAR::JAZZ)
		canvas.drawSprite(jjSubscreenWidth-20, jjSubscreenHeight-25, ANIM::AMMO, play.charCurr == CHAR::SPAZ ? 19 : 18, 3, 0, SPRITE::NORMAL, 0);
	if (jjIsTSF) {
	if (play.charCurr == CHAR::LORI)
		canvas.drawSprite(jjSubscreenWidth-20, jjSubscreenHeight-25, ANIM::PLUS_AMMO, 6, 2, 0, SPRITE::NORMAL, 0);
		}
		return true;
	} else return false;
}