Downloads containing xlmdilap.j2as

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

File preview

#pragma require "FerrisWheel.j2a"
#pragma require "xlmdilap_sounds/rain.wav"
#pragma require "xlmdilap_sounds/rustycreak.wav"
#pragma require "xlmdilap_sounds/raven.wav"
#pragma require "xlmdilap_sounds/pipehit.wav"

/*******************************************************************/

// Dilapidation
// Created by PurpleJazz of XLM (2015)
// Huge thanks to Sir Ementaler for writing the ferris wheel script

/*******************************************************************/

class FerrisWheel {
	private float origin, angle, torque, mobility, deceleration;
	private array<jjOBJ@> objs;
	
	void create(float x, float y, OBJECT::Object type, uint count, float radius, float mass, float resistance) {
		origin = x;
		angle = torque = 0.f;
		mobility = radius / mass;
		deceleration = resistance;
		for (uint i = 0; i < objs.length(); i++) {
			jjOBJ@ obj = @objs[i];
			if (obj !is null)
				obj.delete();
		}
		objs.resize(count);
		for (uint i = 0; i < count; i++) {
			int id = jjAddObject(type, x, y, 0, CREATOR::OBJECT, Platform);
			if (id >= 0) {
				jjOBJ@ obj = @objs[i] = @jjObjects[id];
				obj.age = (i << 10) / count;
				obj.bulletHandling = HANDLING::IGNOREBULLET;
				obj.deactivates = false;
				obj.xAcc = radius;
				obj.yAcc = radius / 64.f;
				obj.determineCurFrame();
			}
		}
	}
	
	void process() {
		uint count = objs.length();
		for (uint i = 0; i < 32; i++) {
			const jjPLAYER@ player = jjPlayers[i];
			if (player.isInGame) {
				bool onWheel;
				if (player.isLocal) {
					onWheel = player.platform != 0 && player.platform < jjObjectMax && objs.findByRef(jjObjects[player.platform]) >= 0;
				} else {
					onWheel = false;
					if (player.ySpeed == 0.f) {
						for (uint j = 0; j < count; j++) {
							const jjOBJ@ obj = @objs[j];
							if (obj !is null) {
								float dx = obj.xPos - player.xPos;
								float dy = obj.yPos - player.yPos - 20.f;
								if (dx * dx + dy * dy < float(0x1000)) {
									onWheel = true;
									break;
								}
							}
						}
					}
				}
				if (onWheel)
					torque += origin - player.xPos;
			}
		}
		if (torque > 0.f) {
			torque -= deceleration;
			if (torque < 0.f)
				torque = 0.f;
		} else if (torque < 0.f) {
			torque += deceleration;
			if (torque > 0.f)
				torque = 0.f;
		}
		float speed = torque * mobility;
		angle += speed;
		int pos = int(angle);
		for (uint i = 0; i < count; i++) {
			jjOBJ@ obj = @objs[i];
			if (obj !is null) {
				int oldAngle = obj.age;
				int newAngle = obj.age = (pos + (i << 10) / count) & 1023;
				int diff = newAngle - oldAngle;
				if (diff > 512 || diff < -512)
					jjSample(obj.xPos, obj.yPos - 20.f, SOUND::INTRO_BRAKE, 0, 20000 + int(abs(speed) * 10000.f));
			}
		}
	}
}

FerrisWheel wheel;
ANIM::Set ferrisWheelAnimSet;

bool lightning = false;
int lightningDelay = 150;

/*******************************************************************/

void onLevelLoad() {
	jjPalette.fill(180,160,150, 11, 1, 1);
	jjPalette.fill(120,100,90, 106, 1, 1);
	jjPalette.gradient(225,215,195, 20,5,0, 97, 8);
	jjPalette.gradient(35,110,65, 0,40,20, 109, 3);
	jjPalette.gradient(80,72,62, 23,17,5, 123, 5);
	jjPalette.gradient(190,135,95, 40,15,5, 144, 8);
	jjPalette.gradient(50,162,82, 0,36,14, 153, 4);
	jjPalette.gradient(130,145,150, 10,15,25, 160, 5);
	jjPalette.gradient(125,135,150, 5,10,20, 165, 5);
	jjPalette.gradient(165,190,195, 25,55,65, 176, 32);
	jjPalette.gradient(100,110,120, 40,50,60, 215, 3);
	jjPalette.gradient(60,112,72, 8,46,26, 218, 3);
	jjPalette.gradient(110,100,120, 2,1,10, 224, 8);
	jjPalette.gradient(80,95,100, 0,2,10, 232, 5);
	jjPalette.fill(94,102,107, 240, 1, 1);
	jjPalette.fill(135,135,135, 243, 1, 1);
	jjPalette.fill(0,30,10, 244, 1, 1);
	
	const array<uint16> Leaves = {
		410, 411, 412, 413, 414, 415, 422, 423, 424, 425, 432, 433, 434, 435, 442, 443, 444, 445
	};
	
	const array<uint16> TilesForNewLeaves = {
		758, 759, 768, 769, 778, 779, 788, 789, 798, 799, 808, 809, 818, 819, 828, 829, 838, 839
	};
	
	const array<uint16> Bushes = {
		653, 654, 655, 663, 664, 665, 666, 667, 668, 678
	};
	
	const array<uint16> TilesForNewBushes = {
		642, 643, 644, 645, 646, 658, 659, 669, 670, 679
	};
	
	jjPIXELMAP blackTile(9);
		for (uint x = 0; x < blackTile.width; ++x) {
			for (uint y = 0; y < blackTile.height; ++y) {
				blackTile[x,y] = 95;
			}
		}
	blackTile.save(9, true);
	
	for (int i = 0; i < 20; i++) {
		jjPIXELMAP caves(100 + i);
			for (uint x = 0; x < caves.width; ++x) {
				for (uint y = 0; y < caves.height; ++y) {
					if ((caves[x,y] < 160 || caves[x,y] > 164) || (caves[x,y + 4] >= 165 && caves[x,y + 4] <= 169))
						caves[x,y] = 0;
					else if (i == 5 || i == 6 || (i == 8 && x > 12) || (i == 9 && x < 20))
						caves[x,y] = 0;
					else if (caves[x,y] >= 160 && caves[x,y] <= 164)
						caves[x,y] += 72;
				}
			}
		caves.save(710 + i, true);
		jjPIXELMAP VFlipCaves(710 + i);
		VFlipCaves.save(730 + i | TILE::VFLIPPED, true);
	}
	
	for (int i = 0; i < 6; i++) {
		jjPIXELMAP caves2(330 + i);
			for (uint x = 0; x < caves2.width; ++x) {
				for (uint y = 0; y < caves2.height; ++y) {
					if (caves2[x,y] == 11 || caves2[x,y] == 106 || caves2[x,y] == 108)
						caves2[x,y] = 0;
					else if (caves2[x,y] >= 160 && caves2[x,y] <= 164)
						caves2[x,y] += 72;
				}
			}
		caves2.save(750 + i, true);
		jjPIXELMAP VFlipCaves2(750 + i);
		VFlipCaves2.save(760 + i | TILE::VFLIPPED, true);
	}
	
	jjPIXELMAP turtleShell(657);
		for (uint x = 0; x < turtleShell.width; ++x) {
			for (uint y = 0; y < turtleShell.height; ++y) {
				if (turtleShell[x,y] >= 88 && turtleShell[x,y] <= 95)
					turtleShell[x,y] += 10;
				if (turtleShell[x,y] >= 40 && turtleShell[x,y] <= 47)
					turtleShell[x,y] += 19;
			}
		}
	turtleShell.save(657, true);

	for (int i = 0; i < 18; i++) {
		jjPIXELMAP lightLeaves(Leaves[i]);
			for (uint x = 0; x < lightLeaves.width; ++x) {
				for (uint y = 0; y < lightLeaves.height; ++y) {
					if (lightLeaves[x,y] >= 109 && lightLeaves[x,y] <= 111)
						lightLeaves[x,y] += 44;
					if (lightLeaves[x,y] == 244)
						lightLeaves[x,y] = 156;
				}
			}
		lightLeaves.save(TilesForNewLeaves[i], true);
	}
	
	for (int i = 0; i < 10; i++) {
		jjPIXELMAP greenBGBushes(Bushes[i]);
			for (uint x = 0; x < greenBGBushes.width; ++x) {
				for (uint y = 0; y < greenBGBushes.height; ++y) {
					if (greenBGBushes[x,y] == 0)
						greenBGBushes[x,y] = 220;
				}
			}
		greenBGBushes.save(TilesForNewBushes[i], true);
	}
	
	jjPIXELMAP vine(418);
	for (uint x = 0; x < vine.width; ++x) {
		for (uint y = 0; y < vine.height; ++y) {
			if (vine[x,y] == 209 && vine[x,y - 1] == 0)
				vine[x,y] = 243;
			else if (vine[x,y] == 209 && vine[x,y + 1] == 0)
				vine[x,y] = 209;
		}
	}
	vine.save(418, true);
	
	jjPIXELMAP cableHorizontal(419);
	for (uint x = 0; x < cableHorizontal.width; ++x) {
		for (uint y = 0; y < cableHorizontal.height; ++y) {
			if (cableHorizontal[x,y] == 209 && cableHorizontal[x,y - 1] == 0)
				cableHorizontal[x,y] = 211;
			else if (cableHorizontal[x,y] == 209 && cableHorizontal[x,y + 1] == 0)
				cableHorizontal[x,y] = 209;
		}
	}
	cableHorizontal.save(419, true);
	
	jjPIXELMAP cableVertical(10, 32);
	for (uint x = 0; x < cableVertical.width; ++x)
		for (uint y = 0; y < cableVertical.height; ++y) {
			uint8 color = cableHorizontal[y, x + 6];
			if (color == 0) color = 128;
			cableVertical[x,y] = color;
		}
	cableVertical.save(jjAnimFrames[jjAnimations[jjAnimSets[ANIM::VINE].firstAnim + 1].firstFrame]);
	
	jjTexturedBGTexture = TEXTURE::MEDIVO;
	jjTexturedBGFadePositionY = 0.55;
	jjUseLayer8Speeds = true;
	
	jjSetWaterGradient(0, 40, 20, 0, 250, 150);
	jjSetWaterLevel(49.5*32, true);
	
	jjAnimSets[ANIM::CUSTOM[0]].load(0, "FerrisWheel.j2a");
	jjAnimations[jjAnimSets[ANIM::SONICPLAT] + 0] = jjAnimations[jjAnimSets[ANIM::CUSTOM[0]] + 0];
	jjAnimations[jjAnimSets[ANIM::SONICPLAT] + 1] = jjAnimations[jjAnimSets[ANIM::CUSTOM[0]] + 1];
	
	jjAnimSets[ANIM::BAT].load();
	jjAnimSets[ANIM::RAPIER].load();
	jjAnimSets[ANIM::RAVEN].load();
	jjAnimSets[ANIM::SKELETON].load();
	jjAnimSets[ANIM::WITCH].load();
	
	jjANIMATION@ anim = jjAnimations[jjAnimSets[ANIM::BAT] + 1];
		for (uint j = 0; j < anim.frameCount; j++) {
			jjANIMFRAME@ frame = jjAnimFrames[anim + j];
			jjPIXELMAP sprite(frame);
			for (uint x = 0; x < sprite.width; ++x) {
				for (uint y = 0; y < sprite.height; ++y) {
					if (sprite[x,y] >= 88 && sprite[x,y] <= 95) sprite[x,y] += 136;
				}
			}
			sprite.save(frame);
		}
		
	jjANIMATION@ anim2 = jjAnimations[jjAnimSets[ANIM::CUSTOM[0]] + 0];
		for (uint j = 0; j < anim2.frameCount; j++) {
			jjANIMFRAME@ frame = jjAnimFrames[anim2 + j];
			jjPIXELMAP sprite(frame);
			for (uint x = 0; x < sprite.width; ++x) {
				for (uint y = 0; y < sprite.height; ++y) {
					if (sprite[x,y] >= 24 && sprite[x,y] <= 31) sprite[x,y] += 90;
					else if (sprite[x,y] >= 72 && sprite[x,y] <= 79) sprite[x,y] -= 0;
				}
			}
			sprite.save(frame);
		}
	
	jjSampleLoad(SOUND::INTRO_BLOW, "xlmdilap_sounds/rain.wav");
	jjSampleLoad(SOUND::INTRO_BRAKE, "xlmdilap_sounds/rustycreak.wav");
	jjSampleLoad(SOUND::INTRO_GRAB, "xlmdilap_sounds/raven.wav");
	jjSampleLoad(SOUND::PINBALL_BELL, "xlmdilap_sounds/pipehit.wav");
	
	jjObjectPresets[OBJECT::BOUNCERPOWERUP].direction = -1;
	jjObjectPresets[OBJECT::RFPOWERUP].direction = 0;
	
	jjObjectPresets[OBJECT::REDSPRING].behavior = 
	jjObjectPresets[OBJECT::GREENSPRING].behavior = 
	jjObjectPresets[OBJECT::BLUESPRING].behavior = Spring;
	
	jjObjectPresets[OBJECT::SWINGINGVINE].behavior = ShortVine;
	
	for (int i = 1; i < 255; i++) {
		if (jjObjectPresets[i].playerHandling == HANDLING::PICKUP) {
			jjObjectPresets[i].behavior = CannotBeBuried;
		}
	}
	
	jjOBJ@ preset = jjObjectPresets[OBJECT::FROZENSPRING];
	preset.behavior = coloredSpring;
	preset.bulletHandling = HANDLING::IGNOREBULLET;
	preset.freeze = 0;
	preset.ySpeed = -18.f;
	
	jjObjectPresets[OBJECT::FLICKERLIGHT].behavior = torch;
	
	createFerrisWheelAnimSet(ANIM::CUSTOM[1], 176, 32, 12, 286);
	if (jjGameMode != GAME::SP) wheel.create(66.25*32, 35.25*32, OBJECT::SONICPLATFORM, 12, 286.f, 4400000.f, 80.f);
}

void createFerrisWheelAnimSet(ANIM::Set set, int gradientStart, int gradientLength, int count, int radius) {
	int animSet = jjAnimSets[ferrisWheelAnimSet = set].allocate(array<uint> = {32, 32});
	float amp = (gradientLength >> 1) - 1;
	float color = gradientStart + amp, color2 = color + 0.5f;
	{
		int anim = jjAnimations[animSet + 0];
		for (int i = 0; i < 32; i++) {
			jjPIXELMAP image(64, 9);
			float imp = amp * jjSin((i << 5) - 96);
			int start = int(color + imp), end = int(color2 - imp);
			for (int j = 0; j < 9; j++) {
				int index = ((start * (8 - j) + end * j) >> 3) + (j < 2 || j > 6 ? 1 : 0);
				for (int k = 0; k < 64; k++) {
					image[k, j] = index;
				}
			}
			jjANIMFRAME@ frame = jjAnimFrames[anim + i];
			image.save(frame);
			frame.hotSpotY = -4;
		}
	}
	{
		int radius2 = radius * radius;
		int radiusM9 = radius - 9;
		int radiusM92 = radiusM9 * radiusM9;
		int anim = jjAnimations[animSet + 1];
		for (int i = 0; i < 32; i++) {
			int arg = 1024 / count;
			int width = int(radius * (1 - jjCos(arg))) + 16;
			int height = int(radius * jjSin(arg)) + 16;
			jjPIXELMAP image(width, height);
			float imp = int(amp * jjSin((i << 5) + 160));
			int start = int(color + imp), end = int(color2 - imp);
			for (int j = 0; j < width; j++) {
				int a = radius - j;
				int a2 = a * a;
				for (int k = 0; k < height; k++) {
					int b2 = k * k;
					int dist2 = a2 + b2;
					if (dist2 >= radiusM92 && dist2 < radius2) {
						int fac = radius - int(sqrt(dist2));
						if (fac > 8)
							fac = 8;
						image[j, k] = ((start * (8 - fac) + end * fac) >> 3) + (fac < 2 || fac > 6 ? 1 : 0);
					}
				}
			}
			jjANIMFRAME@ frame = jjAnimFrames[anim + i];
			image.save(frame);
			frame.hotSpotX = -4;
		}
	}
}

void Platform(jjOBJ@ obj) {
	if (obj.xAcc != 0.f) {
		float xOld = obj.xPos;
		float yOld = obj.yPos;
		obj.xPos = obj.xOrg + obj.xAcc * jjSin(obj.age);
		obj.yPos = obj.yOrg + obj.xAcc * jjCos(obj.age);
		obj.bePlatform(xOld, yOld);
		for (int i = 0; i < 2; i++) {
			jjDrawRotatedSprite(obj.xPos, obj.yPos, ferrisWheelAnimSet, i, obj.age >> 5, obj.age + 256, i == 0 ? obj.yAcc : 1.f, 1.f, SPRITE::NORMAL, 0, 5);
		}
		obj.draw();
	}
}

void Spring(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::SPRING);
	if ((obj.xPos > 34*32 && obj.xPos < 36*32 && obj.yPos > 33*32 && obj.yPos < 35*32) ||
	(obj.xPos > 46*32 && obj.xPos < 48*32 && obj.yPos > 30*32 && obj.yPos < 32*32) ||
	(obj.xPos > 48*32 && obj.xPos < 50*32 && obj.yPos > 47*32 && obj.yPos < 49*32) ||
	(obj.xPos > 75*32 && obj.xPos < 77*32 && obj.yPos > 46*32 && obj.yPos < 48*32) ||
	(obj.xPos > 75*32 && obj.xPos < 77*32 && obj.yPos > 46*32 && obj.yPos < 48*32) ||
	(obj.xPos > 94*32 && obj.xPos < 96*32 && obj.yPos > 23*32 && obj.yPos < 25*32) ||
	(obj.xPos > 94*32 && obj.xPos < 96*32 && obj.yPos > 31*32 && obj.yPos < 33*32) ||
	(obj.xPos > 119*32 && obj.xPos < 121*32 && obj.yPos > 45*32 && obj.yPos < 47*32)) obj.xPos = obj.xOrg + 8;
	if (obj.xPos > 107*32 && obj.xPos < 109*32 && obj.yPos > 31*32 && obj.yPos < 33*32) obj.xPos = obj.xOrg - 8;
}

void ShortVine(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::SWINGINGVINE);
	obj.playerHandling = HANDLING::PARTICLE;
	obj.var[1] = 104;
}

void CannotBeBuried(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::PICKUP);
	if (jjMaskedPixel(int(obj.xPos), int(obj.yPos) + 8) || (jjMaskedPixel(int(obj.xPos) + 4, int(obj.yPos)) && !jjMaskedPixel(int(obj.xPos) + 8, int(obj.yPos))) || (jjMaskedPixel(int(obj.xPos) - 4, int(obj.yPos)) && !jjMaskedPixel(int(obj.xPos) - 8, int(obj.yPos)))) {
		obj.state = STATE::FLOAT;
	}
}

void coloredSpring(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::SPRING, false);
	jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 216, 2, 2);
}

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

void onMain() {
	wheel.process();

	if (!jjLowDetail) {
		if (!jjTriggers[30]) {
			jjIsSnowing = true;
			if (jjGameTicks % 900 == 0) jjSample(jjLocalPlayers[0].xPos, jjLocalPlayers[0].yPos < jjWaterLevel? jjLocalPlayers[0].yPos : jjWaterLevel, SOUND::INTRO_GRAB, 56, 0);
		}
		else jjIsSnowing = false;
		
		jjWaterLayer = 1;
		jjWaterLighting = WATERLIGHT::GLOBAL;
		
		if (jjGameTicks % 140 == 0) jjSample(jjLocalPlayers[0].xPos, jjLocalPlayers[0].yPos < jjWaterLevel? jjLocalPlayers[0].yPos : jjWaterLevel, SOUND::INTRO_BLOW, jjTriggers[30]? 12:56, 0);
	
		if (lightning && lightningDelay > 0) lightningDelay--;
	
		if (jjGameTicks % 600 >= 575 && jjGameTicks % 600 <= 579) jjSetFadeColors(255,255,255);
		else if (jjGameTicks % 600 >= 580) {
			int timer = 600 - jjGameTicks % 600;
			jjSetFadeColors(15 + timer * 195 / 20, 30 + timer * 180 / 20, 45 + timer * 165 / 20);
			lightning = true;
			lightningDelay = 150;
		}
	
		if (lightning && lightningDelay == 0) {
			jjSample(jjLocalPlayers[0].xPos, jjLocalPlayers[0].yPos < jjWaterLevel? jjLocalPlayers[0].yPos : jjWaterLevel, SOUND::BILSBOSS_THUNDER, jjTriggers[30]? 12:42, 0);
			lightning = false;
		}
	}
	else {
		jjIsSnowing = false;
		jjWaterLayer = 9;
		jjWaterLighting = WATERLIGHT::NONE;
	}
	
	for (int i = 0; i < 32; i++) {
		jjPlayers[i].lightType = LIGHT::NONE;
	}
}

void onPlayer(jjPLAYER@ play) {
	play.lighting = jjTriggers[30]? 55:85;
}

void onDrawLayer2(jjPLAYER@ play, jjCANVAS@ canvas) {
	canvas.drawSprite(89*32, int(43.3*32), ANIM::BAT, 1, 1, 0, SPRITE::NORMAL);
	canvas.drawSprite(int(106.5*32), int(36.3*32), ANIM::BAT, 1, 1, 0, SPRITE::NORMAL);
	canvas.drawSprite(114*32, int(38.3*32), ANIM::BAT, 1, 1, -1, SPRITE::NORMAL);

	canvas.drawRectangle(16, 1280, 96, 64, 75, SPRITE::NORMAL);
	canvas.drawRectangle(18, 1282, 92, 60, 77, SPRITE::NORMAL);
	canvas.drawRectangle(20, 1284, 88, 56, 95, SPRITE::NORMAL);
	canvas.drawString(36, 1304, "|||PARK", STRING::SMALL, STRING::NORMAL);
	canvas.drawString(28, 1320, "|||CLOSED", STRING::SMALL, STRING::NORMAL);
	
	canvas.drawRectangle(3856, 608, 96, 64, 75, SPRITE::NORMAL);
	canvas.drawRectangle(3858, 610, 92, 60, 77, SPRITE::NORMAL);
	canvas.drawRectangle(3860, 612, 88, 56, 95, SPRITE::NORMAL);
	canvas.drawString(3876, 632, "|||KEEP", STRING::SMALL, STRING::NORMAL);
	canvas.drawString(3876, 648, "|||OUT!", STRING::SMALL, STRING::NORMAL);
	
	if (jjLowDetail) canvas.drawRectangle(0, int(jjWaterLevel), jjLayerWidth[2]*32, jjLayerHeight[2]*32 - int(jjWaterLevel), 86, SPRITE::TRANSLUCENT);
}

void onDrawLayer4(jjPLAYER@ play, jjCANVAS@ canvas) {
	canvas.drawSprite(85*32, 47*32, ANIM::SKELETON, 2, 12, 0, SPRITE::SINGLEHUE, 64);
	canvas.drawSprite(118*32, 46*32, ANIM::SKELETON, 2, 12, -1, SPRITE::SINGLEHUE, 64);
	canvas.drawSprite(105*32, 53*32, ANIM::JAZZ, jjIsTSF? 3:4, 0, 0, SPRITE::SINGLEHUE, 80);
	canvas.drawSprite(int(118.5*32), 41*32, ANIM::WITCH, 2, 1, -1, SPRITE::NEONGLOW, 1);
	canvas.drawSprite(95*32, 48*32, ANIM::RAPIER, 1, 1, 0, SPRITE::NEONGLOW, 0);
	canvas.drawSprite(int(96.5*32), 44*32, ANIM::RAPIER, 0, 0, 0, SPRITE::NEONGLOW, 0);
	canvas.drawSprite(int(99.5*32), int(41.5*32), ANIM::RAPIER, 2, 3, 0, SPRITE::NEONGLOW, 0);
	canvas.drawSprite(108*32, 48*32, ANIM::RAPIER, 4, 2, -1, SPRITE::NEONGLOW, 0);
	canvas.drawSprite(int(110.5*32), 37*32, ANIM::RAVEN, 0, 0, 0, SPRITE::NEONGLOW, 5);
	canvas.drawSprite(int(111.5*32), 30*32, ANIM::RAVEN, 2, 5, 0, SPRITE::NEONGLOW, 5);
	
	canvas.drawRectangle(2692, 1412, 88, 56, 95, SPRITE::TRANSLUCENT);
}

void onDrawLayer5(jjPLAYER@ play, jjCANVAS@ canvas) {
	canvas.drawRectangle(2688, 1408, 96, 64, 26, SPRITE::NORMAL);
	canvas.drawRectangle(2690, 1410, 92, 60, 29, SPRITE::NORMAL);
	canvas.drawRectangle(2692, 1412, 88, 56, 95, SPRITE::NORMAL);
	canvas.drawString(2696, 1434, "||CAVE OF", STRING::SMALL, STRING::NORMAL);
	canvas.drawString(2696, 1450, "||HORROR", STRING::SMALL, STRING::NORMAL);
}

void onDrawLayer6(jjPLAYER@ play, jjCANVAS@ canvas) {
	float xPos = jjSin(jjGameTicks)*-128 + 750;
	float yPos = jjCos(jjGameTicks)*32 + 250;

	canvas.drawResizedSprite(int(xPos), int(yPos), ANIM::RAVEN, yPos > 7.82*32 && yPos < 7.9*32? 2:1, jjGameTicks >> 3, yPos <= 7.9*32? 0.38:-0.45, yPos <= 7.9*32? 0.38:0.45, SPRITE::SINGLECOLOR, 95);
}

void onDrawLayer7(jjPLAYER@ play, jjCANVAS@ canvas) {
	float xPos = jjSin(jjGameTicks)*64 + 100;
	float yPos = jjCos(jjGameTicks)*16 + 90;

	canvas.drawResizedSprite(int(xPos), int(yPos), ANIM::RAVEN, yPos > 2.82*32 && yPos < 2.9*32? 2:1, jjGameTicks >> 3, yPos >= 2.9*32? 0.25:-0.18, yPos >= 2.9*32? 0.25:0.18, SPRITE::SINGLECOLOR, 95);
}

void onFunction0(jjPLAYER@ play) {
	play.showText("@@@@@@Dilapidation@Created by PurpleJazz of XLM (2015)@Tileset by Moonblaze@np: Michiel van den Bos - Hub 3 [3:30]");
}