Downloads containing xlmforgotciv.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Anniversary Bash 17 Levels Jazz2Online Multiple N/A Download file

File preview

// Forgotten Civilisation
// Created by PurpleJazz of XLM (2011-2015)

/*******************************************************************/
#pragma require "BubbleGun.j2a"

void onLevelLoad() {
	jjAnimSets[ANIM::CUSTOM[0]].load(0, "BubbleGun.j2a");
	jjAnimSets[ANIM::CUSTOM[1]].load(1, "BubbleGun.j2a");
	jjAnimSets[ANIM::CUSTOM[2]].load(2, "BubbleGun.j2a");
	jjAnimations[jjAnimSets[ANIM::AMMO] + 62] = jjAnimations[jjAnimSets[ANIM::AMMO] + 8];
	jjAnimations[jjAnimSets[ANIM::AMMO] + 61] = jjAnimations[jjAnimSets[ANIM::CUSTOM[0]] + 0];

	jjTexturedBGTexture = TEXTURE::XARGON;
	jjTexturedBGFadePositionY = 0.65;

	jjWaterChangeSpeed = 0;
	jjSetWaterLevel(32*93, true);
	jjWaterLighting = WATERLIGHT::GLOBAL;
	
	jjObjectPresets[OBJECT::FLICKERLIGHT].behavior = torch;
	
	jjObjectPresets[OBJECT::CARROT].behavior = CantBeBuried;
	jjObjectPresets[OBJECT::FULLENERGY].behavior = CantBeBuried;
	
	jjObjectPresets[OBJECT::ICEAMMO15].behavior = BubbleCrate;
	jjObjectPresets[OBJECT::ICEAMMO15].var[2] = OBJECT::GUN8AMMO3;
	
	jjObjectPresets[OBJECT::FIREBALLBULLET].special = jjObjectPresets[OBJECT::FIREBALLBULLET].determineCurAnim(ANIM::AMMO, 8);
	jjObjectPresets[OBJECT::FIREBALLBULLET].behavior = BubbleGun;
	jjObjectPresets[OBJECT::FIREBALLBULLET].xSpeed = 1.25;
	jjObjectPresets[OBJECT::FIREBALLBULLET].counterEnd = 105;

	jjObjectPresets[OBJECT::FIREBALLBULLETPU].special = jjObjectPresets[OBJECT::FIREBALLBULLETPU].determineCurAnim(ANIM::CUSTOM[0], 0);
	jjObjectPresets[OBJECT::FIREBALLBULLETPU].behavior = BubbleGunPU;
	jjObjectPresets[OBJECT::FIREBALLBULLETPU].xSpeed = 1.5;
	jjObjectPresets[OBJECT::FIREBALLBULLETPU].counterEnd = 105;
	
	jjObjectPresets[OBJECT::BOUNCERPOWERUP].direction = 0;
	jjObjectPresets[OBJECT::GUN8POWERUP].determineCurAnim(ANIM::CUSTOM[1], 0, true);
	
	jjWeapons[WEAPON::GUN8].spread = SPREAD::NORMAL;
	jjWeapons[WEAPON::GUN8].gradualAim = false;
	jjWeapons[WEAPON::GUN8].defaultSample = false;
	
	jjWeapons[WEAPON::ICE].maximum = 0;
	jjWeapons[WEAPON::SEEKER].maximum = 25;
}

void torch(jjOBJ@ obj) {
	jjDrawSprite(obj.xPos+5, obj.yPos-11, ANIM::AMMO, 13, jjGameTicks / 10 % 6);
}

void CantBeBuried(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::PICKUP);
	if (jjMaskedPixel(int(obj.xPos), int(obj.yPos) + 8)) {
		obj.state = STATE::FLOAT;
	}
}

void BubbleCrate(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::AMMO15, false);
	jjDrawSprite(int(obj.xPos), int(obj.yPos), ANIM::CUSTOM[2], 0, 0, SPRITE::NORMAL);
}

void BubbleGun(jjOBJ@ bubble) {
    if (bubble.state == STATE::START) {
		bubble.state = STATE::FLY;
		jjSample(bubble.xPos, bubble.yPos, SOUND::COMMON_PLOP2, 0, 0);
	}
	
	if (jjMaskedPixel(int(bubble.xPos) + int(bubble.xSpeed), int(bubble.yPos)) || jjMaskedPixel(int(bubble.xPos) - int(bubble.xSpeed), int(bubble.yPos)) || jjMaskedPixel(int(bubble.xPos), int(bubble.yPos) + int(bubble.ySpeed)) || jjMaskedPixel(int(bubble.xPos), int(bubble.yPos) - int(bubble.ySpeed))) {
		jjSample(bubble.xPos, bubble.yPos, SOUND::P2_SPLOUT, 0, 0);
	}
	
	bubble.behave(BEHAVIOR::WATERSHIELDBULLET);
	bubble.killAnim = jjObjectPresets[OBJECT::WATERSHIELDBULLET].killAnim;
}

void BubbleGunPU(jjOBJ@ bubble) {
	if (bubble.state == STATE::START) {
		bubble.state = STATE::FLY;
		jjSample(bubble.xPos, bubble.yPos, SOUND::COMMON_PLOP2, 0, 0);
	}

	if (jjMaskedPixel(int(bubble.xPos) + int(bubble.xSpeed), int(bubble.yPos)) || jjMaskedPixel(int(bubble.xPos) - int(bubble.xSpeed), int(bubble.yPos)) || jjMaskedPixel(int(bubble.xPos), int(bubble.yPos) + int(bubble.ySpeed)) || jjMaskedPixel(int(bubble.xPos), int(bubble.yPos) - int(bubble.ySpeed))) {
		jjSample(bubble.xPos, bubble.yPos, SOUND::P2_SPLOUT, 0, 0);
	}
	
	bubble.behave(BEHAVIOR::WATERSHIELDBULLET);
	
	if (bubble.state == STATE::FLY && bubble.counter > 0) {
		switch (bubble.direction) {
			case 1: bubble.xSpeed = bubble.xSpeed - 0.1; bubble.ySpeed = bubble.ySpeed - 0.08; break;
			case -1: bubble.xSpeed = bubble.xSpeed + 0.1; bubble.ySpeed = bubble.ySpeed - 0.08; break;
		}
	}
	
	bubble.killAnim = jjObjectPresets[OBJECT::WATERSHIELDBULLET].killAnim;
	bubble.var[6] = 8;
}

void onPlayer(jjPLAYER@ play) {
	play.lighting = 80;
}

void onFunction0(jjPLAYER@ play) {
	play.showText("@@@@@@Forgotten Civilisation@Created by PurpleJazz of XLM (2011-2015)@Tileset by ET, edited by PurpleJazz@np: Kevin Riepl - Atlantis [3:03]");
}