Name | Author | Game Mode | Rating | |||||
---|---|---|---|---|---|---|---|---|
RabbitCity 2 | P4rr0t | Single player | 7.7 |
/*************************************************
Created by Parrot86 - RabbitCity 2: The Secret Room
*************************************************/
void onLevelLoad() {
jjAlert("||Level Name: |Police Station - Entrance");
jjAlert("||RabbitCity 2: The Secret Room - Level: |2");
jjAlert("");
jjAlert("");
// Blaster is limited ammo - Thank for zepect!
jjWeapons[WEAPON::BLASTER].infinite = false;
jjWeapons[WEAPON::BLASTER].maximum = maxBlaster;
}
// 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 == 2) p.warpToID(6, 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, 22, 11, 22, 11)) myArea = 2;
else myArea = 0;
}
bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) {
if(myArea == 2) {
canvas.drawString(60, 300, "Press UP to go through the elevator!", STRING::MEDIUM, STRING::BOUNCE, 1);
}
return false;
}
//Blaster Reloading - Thank for zepect!
bool pressedR = false;
const int maxBlaster = 15;
void doReload() {
for(int i = 0; i < jjLocalPlayerCount; i++)
if(jjLocalPlayers[i].ammo[WEAPON::BLASTER] == 0)
jjLocalPlayers[i].ammo[WEAPON::BLASTER] = maxBlaster;
}
bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
if(player.ammo[WEAPON::BLASTER] == 0)
canvas.drawString(80, jjResolutionHeight - 30, "Press [R] to reload your Blaster!", STRING::MEDIUM, STRING::BOUNCE, 1);
return false;
}
void onMain() {
if(jjKey[0x52] && !pressedR) {
doReload();
pressedR = true;
} else if(!jjKey[0x52]) pressedR = false;
}
void onFunction0() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("|*** WARNING! NO GUNS ALLOWED ***");
jjAlert("");
}
void onFunction1() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("FBI Eva:||||| Player, How are you?");
jjAlert("Player:||||| Fine!");
jjAlert("Player:||||| Do you know, where is the secret room?");
jjAlert("FBI Eva:||||| No");
jjAlert("Player:||||| Hmm... OK");
}
void onFunction2() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("FBI Spaz:||||| Hey, do not enter!");
jjAlert("Player:||||| *sigh*");
}
void onFunction3() {
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("");
jjAlert("Player:||||| Sup!");
jjAlert("FBI Spaz:||||| What?");
}
Jazz2Online © 1999-INFINITY (Site Credits). We have a Privacy Policy. Jazz Jackrabbit, Jazz Jackrabbit 2, Jazz Jackrabbit Advance and all related trademarks and media are ™ and © Epic Games. Lori Jackrabbit is © Dean Dodrill. J2O development powered by Loops of Fury and Chemical Beats.
Eat your lima beans, Johnny.