Downloads containing JC2lvl19.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: RabbitCity 2 P4rr0t Single player 7.7 Download file

File preview

/*************************************************
Created by Parrot86 - RabbitCity 2: The Secret Room
*************************************************/
void onLevelLoad() {
	jjAlert("||Level Name: |Get Out Of Jail Free 1 /5");
	jjAlert("||RabbitCity 2: The Secret Room - Level: |1 9");
	jjAlert("");
	jjAlert("");
}
// Doors - Thank for zepect!
array<bool> keyPressed(256, false); //arrays holds the state of the keys
int myArea = 0;

bool inArea(jjPLAYER@ p, int x1, int y1, int x2, int y2) {
	return ((p.xPos > (x1*32)) && (p.xPos < x2*32 + 32) && (p.yPos > (y1*32)) && (p.yPos < y2*32 + 32));
}
void onKeyDown(jjPLAYER@ p, int key) {
	if(key == 0x26) { //0x26 is up arrow key (all keys at http://msdn.microsoft.com/en-us/library/dd375731(VS.85).aspx)
		if(myArea == 1) p.warpToID(8, true);
		else if(myArea == 2) p.warpToID(9, true);
	}
}

void onPlayer(jjPLAYER@ p) {
	for(int i = 0; i < 256; i++) { //loop through all the keys
		if(jjKey[i] && !keyPressed[i]) {
			onKeyDown(p, i);
			keyPressed[i] = true;
		} else if(!jjKey[i] && keyPressed[i]) keyPressed[i] = false;
	}
	if(inArea(p, 4, 89, 4, 89)) myArea = 1;
	else if(inArea(p, 293, 28, 293, 28)) myArea = 2;
	else myArea = 0;
}

bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) {
	if(myArea == 1 || myArea == 2) {
		canvas.drawString(135, 300, "Press UP to walk through!", STRING::MEDIUM, STRING::BOUNCE, 1);
	}
	return false;
}
void onFunction0() {
	p.showText("@@@@@@@@#YOU FOUND A SECRET!", STRING::MEDIUM);
}
void onFunction1() {
	jjAlert("");
	jjAlert("");
	jjAlert("|RedRazz:|||| I got hacking video surveillance networks with office!");
	jjAlert("Player:||||| Cool");
	jjAlert("|RedRazz:|||| Be careful, do not watch the video surveillance!");
	jjAlert("Player:||||| Hmm.. okay");
	jjAlert("|RedRazz:|||| If you don't have a gun, go to office");
	jjAlert("Player:||||| OK");
}
void onFunction2() {
	p.warpToID(3,true);
	p.showText("@@@@Video Surveillance was detected you!", STRING::MEDIUM);
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("|*******************************************");
	jjAlert("|*** WARNING!  PLAYER HAS BEEN DETECTED ***");
	jjAlert("|*******************************************");
	jjAlert("");
}
void onFunction3() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("|*** IT'S LOCKED ***");
	jjAlert("");
	jjAlert("Player:||||| Uh...");
}
void onFunction4() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("|*** NOTICE:  RESTRICTED AREA ***");
	jjAlert("This area is under 24hour video surveillance!");
	jjAlert("|*** WARNING:  NO GUNS ALLOWED ***");
	jjAlert("");
}
void onFunction5() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("|*** IT'S LOCKED - ID ACCESS CARD REQUIRED ***");
	jjAlert("");
	jjAlert("Player:||||| Uh, I don't have ID access card...");
}
void onFunction6() {
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("");
	jjAlert("Player:||||| I don't have a gun");
	jjAlert("Player:||||| I find the armoury room");
}
void onDrawLayer4(jjPLAYER@ p, jjCANVAS@ canvas) {
	canvas.drawString(212*32, 82*32-16, "|-GreenSpaz-",STRING::SMALL);
	canvas.drawString(277*32, 92*32-16, "||DANGER",STRING::MEDIUM);
	canvas.drawString(290*32+10, 91*32-16, "|OFFICE",STRING::MEDIUM);
}