#include "MLLE-Include-1.4.asc" const bool MLLESetupSuccessful = MLLE::Setup(); #pragma require "JazzCity2_Boat.j2t" #pragma require "JC2lvl26.j2l" /************************************************* Created by Parrot86 - RabbitCity 2: The Secret Room Remastered *************************************************/ void onLevelLoad() { jjAlert("||Level Name: |Metro 3/1 0"); jjAlert("||RabbitCity 2: The Secret Room Remastered - Level: |2 6"); jjAlert(""); jjAlert(""); } // Doors - Thank for zepect! array 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(2, true); else if(myArea == 2) p.warpToID(1, 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, 258, 168, 258, 168)) myArea = 1; else if(inArea(p, 18, 14, 18, 14)) myArea = 2; else myArea = 0; } bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) { if(myArea == 1 || myArea == 2) { canvas.drawString(220, 370, "Press UP to walk through!", STRING::MEDIUM, STRING::BOUNCE, 1); } return false; } void onFunction0() { jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert("Player:||||| I can't go!"); } void onFunction1() { jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert("|*** WARNING ***"); jjAlert("|* DO NOT ENTER *"); jjAlert(""); } void onFunction2() { jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert("|*** IT'S LOCKED - SILVER KEY REQUIRED ***"); jjAlert(""); jjAlert(""); } void onFunction3() { jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert("|*** IT'S LOCKED - RED ACCESS CARD REQUIRED ***"); jjAlert(""); jjAlert(""); } void onFunction4() { jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert(""); jjAlert("Player:||||| I found a silver key!"); } void onFunction5() { p.showText("@@@@@@@@#YOU FOUND A SECRET AREA!", STRING::MEDIUM); } void onDrawLayer4(jjPLAYER@ p, jjCANVAS@ canvas) { canvas.drawString(226*32-5, 30*32-16, "||||EXIT",STRING::MEDIUM); canvas.drawString(256*32-2, 166*32-18, "||||POWER",STRING::MEDIUM); } void onDrawLayer5(jjPLAYER@ p, jjCANVAS@ canvas) { canvas.drawString(191*32, 24*32-14, "||||Server Room",STRING::SMALL); }