Name | Author | Game Mode | Rating | |||||
---|---|---|---|---|---|---|---|---|
Mystery of the Four... | chandie | Single player | 6.6 |
const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, null, DefaultWeapons::Blaster(), DefaultWeapons::Blaster(), WeaponVMega::Backfire::Weapon(), null, ArcaneWeapons::FusionCannon::Weapon(), null, ArcaneWeapons::MortarLauncher::Weapon()}); ///@MLLE-Generated
#include "MLLE-Include-1.5w.asc" ///@MLLE-Generated
#pragma require "mo4a_3-2.j2l" ///@MLLE-Generated
#include "ArcaneWeapon4.asc" ///@MLLE-Generated
#pragma require "ArcaneWeapon4.asc" ///@MLLE-Generated
#include "ArcaneWeapon9.asc" ///@MLLE-Generated
#pragma require "ArcaneWeapon9.asc" ///@MLLE-Generated
#include "WeaponVMega5.asc" ///@MLLE-Generated
#pragma require "WeaponVMega5.asc" ///@MLLE-Generated
#include "MLLE-DefaultWeapons.asc" ///@MLLE-Generated
#pragma require "MLLE-DefaultWeapons.asc" ///@MLLE-Generated
#include "Jazz1Enemies v05.asc"
#include "Resize v11.asc"
#include "TrueColor v13.asc"
#include "HH18savegems.asc"
bool onDrawHealth(jjPLAYER@ player, jjCANVAS@ canvas) {
canvas.drawString(30, 585, formatInt(exit%100, "1") + "/50", STRING::SMALL, STRING::NORMAL);
canvas.drawSprite(20, 585, ANIM::PICKUPS, 22, jjGameTicks>>2, -1, SPRITE::GEM, 6);
return false;
}
bool onDrawLives(jjPLAYER@ player, jjCANVAS@ canvas) {return true;}
void onLevelLoad() {
jjSetWaterLevel(2032, true);
jjPIXELMAP rain(32,32);
for (uint x = 0; x < rain.width; ++x) {
for (uint y = 0; y < rain.height; ++y) {
if (x == 16) { //draw in the middle of the tile, xPixel 16
if (y <= 24) rain[x,y] = 75; //if at yPixel 24 or less, use color 75
else rain[x,y] = 74; //use color 74 for yPixels 25-32
} else {
rain[x,y] = 0;
}
}
}
jjANIMATION@ anim = jjAnimations[jjAnimSets[ANIM::COMMON].firstAnim + 2];
for (uint frameID = 0; frameID < anim.frameCount; ++frameID) {
jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame + frameID];
rain.save(frame);
frame.hotSpotX = -frame.width/2;
frame.hotSpotY = -frame.height;
}
gem::restorePlayerGems();
jjLevelName = ("@@@@@@@@@Rebellius");
jjWaterLighting = WATERLIGHT::GLOBAL;
jjObjectPresets[OBJECT::SAVEPOST].behavior = CheckpointWrapper;
jjObjectPresets[OBJECT::SAVEPOST].deactivates = false;
Jazz1::MakeEnemy(OBJECT::HATTER, Jazz1::Enemies::Marbelara_Schwarzenguard, true).SetUsesJJ2StyleDeathAnimation(true).SetBulletFireSound(SOUND::INTRO_SHOT1).SetBulletExplosionSound(SOUND::COMMON_GUNSM1);
Jazz1::MakeEnemy(OBJECT::DRAGONFLY, Jazz1::Enemies::Marbelara_Drageen).SetUsesJJ2StyleDeathAnimation(true);
Jazz1::MakeEnemy(OBJECT::FLOATSUCKER, Jazz1::Enemies::Marbelara_Firebomb).SetUsesJJ2StyleDeathAnimation(true);
Jazz1::MakeEnemy(OBJECT::NORMTURTLE, Jazz1::Enemies::Dreempipes_TerrapinSwimmer).SetUsesJJ2StyleDeathAnimation(true);
jjObjectPresets[OBJECT::BIGROCK].behavior = Cannon();
jjObjectPresets[OBJECT::BIGROCK].scriptedCollisions = true;
jjObjectPresets[OBJECT::BIGROCK].bulletHandling = HANDLING::IGNOREBULLET;
jjObjectPresets[OBJECT::FATCHICK].behavior = Pirate2();
jjObjectPresets[OBJECT::FATCHICK].scriptedCollisions = true;
jjObjectPresets[OBJECT::FATCHICK].deactivates = false;
jjObjectPresets[OBJECT::STOPWATCH].behavior = Gem();
jjObjectPresets[OBJECT::STOPWATCH].scriptedCollisions = true;
jjObjectPresets[OBJECT::STOPWATCH].deactivates = false;
jjObjectPresets[OBJECT::SILVERCOIN].behavior = PlatinCoin();
jjObjectPresets[OBJECT::SILVERCOIN].scriptedCollisions = true;
jjObjectPresets[OBJECT::FENCER].behavior = Pirate();
jjObjectPresets[OBJECT::FENCER].playerHandling = HANDLING::SPECIAL;
jjObjectPresets[OBJECT::FENCER].scriptedCollisions = true;
jjObjectPresets[OBJECT::FENCER].energy = 1;
jjObjectPresets[OBJECT::FIREBALLBULLET].scriptedCollisions = true;
jjObjectPresets[OBJECT::FIREBALLBULLET].behavior = CannonBall;
jjObjectPresets[OBJECT::FIREBALLBULLET].state = STATE::ACTION;
jjObjectPresets[OBJECT::FIREBALLBULLET].playerHandling = HANDLING::PLAYERBULLET;
jjObjectPresets[OBJECT::FIREBALLBULLET].bulletHandling = HANDLING::HURTBYBULLET;
jjObjectPresets[OBJECT::STANDMONKEY].behavior = PirateBoss;
jjObjectPresets[OBJECT::STANDMONKEY].playerHandling = HANDLING::ENEMY;
jjObjectPresets[OBJECT::STANDMONKEY].bulletHandling = HANDLING::HURTBYBULLET;
jjObjectPresets[OBJECT::STANDMONKEY].determineCurAnim(ANIM::FENCER, 0);
jjObjectPresets[OBJECT::STANDMONKEY].determineCurFrame();
jjObjectPresets[OBJECT::STANDMONKEY].energy = 100;
jjObjectPresets[OBJECT::STANDMONKEY].deactivates = false;
jjObjectPresets[OBJECT::BLUESPRING].deactivates = false;
}
int exit = 0;
class Gem: jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
obj.behave(BEHAVIOR::PICKUP, false);
obj.determineCurAnim(ANIM::PICKUPS, 22);
jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::GEM, 6);
++obj.counter;
obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
}
bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ play, int force) {
exit += 1;
obj.behavior = BEHAVIOR::EXPLOSION2;
if(exit==50)
{p.showText("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Treasure collected.");}
jjSample(obj.xPos, obj.yPos, SOUND::COMMON_PICKUP1);
return true;
}
}
bool cointext = false;
class PlatinCoin : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
obj.behave(BEHAVIOR::PICKUP, false);
++obj.counter;
obj.yPos = jjSin(obj.counter*15 + 5)*4 + obj.yOrg;
if(exit >= 50)
{jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, -8);}
else jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::TRANSLUCENTPALSHIFT, -8);
}
bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
if(exit < 50 && cointext == false)
{p.showText("@@Collect the treasure first.");
cointext = true;}
if(exit >= 50)
{p.coins += 1;
obj.behavior = BEHAVIOR::EXPLOSION2;
jjSample(obj.xPos, obj.yPos, SOUND::COMMON_COIN, 1000);}
return true;
}
}
class Pirate : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
obj.behave(BEHAVIOR::FENCER, false);
obj.determineCurAnim(ANIM::FENCER, 0);
obj.determineCurFrame();
jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, -24);
if(obj.energy <= 0)
{ jjAddObject(OBJECT::STOPWATCH, obj.xPos, obj.yPos-32);}
}
bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ play, int force) {
if(play !is null && bullet is null)
{obj.playerHandling = HANDLING::ENEMY;}
else if(bullet !is null)
{jjAddObject(OBJECT::FATCHICK, obj.xPos, obj.yPos-32);}
if(force == -1 || force == 1)
{obj.playerHandling = HANDLING::ENEMY;}
return true;
}
}
bool startrush = false;
bool readytorush = false;
void onPlayer(jjPLAYER@ p) {
for (int i = 0; i < 1024; i++) { //loop through the global array jjParticles[1024]
jjPARTICLE@ particle = jjParticles[i];
if (particle.type == PARTICLE::RAIN) {
particle.xSpeed = 0; //make rain fall straight down
particle.ySpeed = p.ySpeed < 0? 10 : int(10 + p.ySpeed); //the rain speed accounts for differences in the player speed, and so won't appear to fall more slowly when the player is falling
}
}
jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::BOLLPLATFORM].curAnim];
anim.frameCount = 1;
jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
jjPIXELMAP lamp(0, 34*32, 2*32, 2*32, 5);
lamp.save(frame);
frame.hotSpotX = -32;
if(p.food == 100 && jjKey[0x52] == false && startrush == false)
{p.showText("@@@@@@@@@@@@@@@@Press 'R' when you need to use Sugar Rush!", STRING::MEDIUM);
p.startSugarRush(0);
startrush = true;
readytorush = true;}
if(readytorush == true)
{p.food = 100;}
if(p.food == 100 && jjKey[0x52])
{p.startSugarRush(1400);
p.food = 0;
readytorush = false;
startrush = false;
}
for (int i = 1; i < jjObjectCount; i++) {
jjOBJ@ o = jjObjects[i];
if (o.isActive && o.eventID == OBJECT::SILVERCOIN && p.coins >= 2) {
o.state = STATE::KILL;
}
}
if(p.yPos > jjWaterLevel && p.xPos > 43*32)
{p.xPos = p.xPos - 4;}
if(p.xPos > 186*32 && p.direction == 1 && p.xSpeed < 1)
{p.keyJump = false;}
if(p.coins == 2 && ((p.xPos > 177*32 && p.yPos < 23*32 && p.yPos >16*32) || (p.xPos > 187*32 && p.yPos < 34*32)))
{jjNxt("mo4a_3-3_save",false, true);
gem::saveGemData();}
if(p.coins < 2 && ((p.xPos > 177*32 && p.yPos < 23*32 && p.yPos >16*32) || (p.xPos > 187*32 && p.yPos < 34*32)))
{p.testForCoins(2);}
if(p.xPos < 23*32 && p.yPos <34*32 && bossdefeated == false)
{jjMusicLoad("mo4a_Umber's Sacrifice.ogg");}
if(p.xPos > 23*32 || p.yPos >34*32)
{jjMusicLoad("mo4a_Riding the Shell.ogg");
p.bossActivated = false;}
p.lightType = LIGHT::NONE;
gem::trackPlayerGems(p);
gem::upgradeHealth(p);
if(p.coins == 0)
{p.coins +=1;}
for (int i = 1; i < jjObjectCount; i++) {
jjOBJ@ o = jjObjects[i];
if (o.isActive && o.eventID == OBJECT::SEEKERAMMO3 && p.ammo[WEAPON::SEEKER] < 1) {
o.state = STATE::KILL;}
}
for (int i = 1; i < jjObjectCount; i++) {
jjOBJ@ o = jjObjects[i];
if (o.isActive && o.eventID == OBJECT::RFAMMO3 && p.ammo[WEAPON::RF] < 1) {
o.state = STATE::KILL;}
}
for (int i = 1; i < jjObjectCount; i++) {
jjOBJ@ o = jjObjects[i];
if (o.isActive && o.eventID == OBJECT::TNTAMMO3 && p.ammo[WEAPON::TNT] < 1) {
o.state = STATE::KILL;}
}
for (int i = 1; i < jjObjectCount; i++) {
jjOBJ@ o = jjObjects[i];
if (o.isActive && o.eventID == OBJECT::GUN9AMMO3 && p.ammo[WEAPON::GUN9] < 1) {
o.state = STATE::KILL;}
}
for (int i = 1; i < jjObjectCount; i++) {
jjOBJ@ o = jjObjects[i];
if (o.isActive && o.eventID == OBJECT::SEEKERPOWERUP && p.ammo[WEAPON::SEEKER] < 1) {
o.state = STATE::KILL;}
}
for (int i = 1; i < jjObjectCount; i++) {
jjOBJ@ o = jjObjects[i];
if (o.isActive && o.eventID == OBJECT::RFPOWERUP && p.ammo[WEAPON::RF] < 1) {
o.state = STATE::KILL;}
}
for (int i = 1; i < jjObjectCount; i++) {
jjOBJ@ o = jjObjects[i];
if (o.isActive && o.eventID == OBJECT::TNTPOWERUP && p.ammo[WEAPON::TNT] < 1) {
o.state = STATE::KILL;}
}
for (int i = 1; i < jjObjectCount; i++) {
jjOBJ@ o = jjObjects[i];
if (o.isActive && o.eventID == OBJECT::GUN9POWERUP && p.ammo[WEAPON::GUN9] < 1) {
o.state = STATE::KILL;}
}
}
class Pirate2 : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
if(obj.energy <= 0) {
obj.state = STATE::KILL;
obj.scriptedCollisions = false;
obj.delete();
}
else {
obj.putOnGround();
obj.behave(BEHAVIOR::WALKINGENEMY, false);
jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, -24);
obj.determineCurAnim(ANIM::FENCER, 0);
obj.determineCurFrame();
obj.xSpeed = 5*obj.direction;
if (jjMaskedVLine(obj.xSpeed > 0 ? obj.xPos + 16 : obj.xPos - 16, obj.yPos, 1))
{obj.direction = obj.xSpeed = -obj.xSpeed;}
}
if(obj.justHit==0)
{jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, -24);}
else obj.draw();
}
}
void onFunction3(jjPLAYER@ play) { exit = 50;}
void onFunction1(jjPLAYER@ play) {
if(bossdefeated == false && bossactivated == false) {
p.activateBoss();
jjTriggers[1] = true;
jjOBJ@ boss = jjObjects[p.boss];
p.boss=jjAddObject(OBJECT::STANDMONKEY, 13, 29*32);
bossactivated = true;
}
}
void onFunction2(jjPLAYER@ play) {
p.health = 0;
}
bool bossdefeated = false, bossactivated = false;
void PirateBoss(jjOBJ@ enemy) {
if(bossdefeated == true)
{enemy.delete();}
if(enemy.energy>0 && p.xPos >20*32)
{p.cameraFreeze(6*32, 27*32, true, false);}
if(enemy.energy <= 0)
{p.cameraUnfreeze();
jjTriggers[1] = false;
bossdefeated = true;}
switch (enemy.state) {
case STATE::START:
enemy.state = STATE::IDLE;
break;
case STATE::IDLE:
enemy.putOnGround(false);
if (jjLocalPlayers[0].xPos < enemy.xPos) enemy.direction = -1;
else enemy.direction = 1;
if ((jjRandom() & 31) == 0) {
enemy.state = STATE::ATTACK;
enemy.determineCurAnim(ANIM::FENCER, 0);
enemy.frameID = 0;
enemy.counter = 0;
jjSample(enemy.xPos, enemy.yPos, SOUND::COMMON_SWISH8);
} else {
if (++enemy.counter > 4) {
enemy.counter = 0;
if (++enemy.frameID >= 11)
enemy.frameID = 0;
}
}
break;
case STATE::ATTACK:
if (++enemy.counter > 6) {
enemy.counter = 0;
if (++enemy.frameID >= 11) {
enemy.determineCurAnim(ANIM::FENCER, 0);
enemy.state = STATE::IDLE;
enemy.frameID = 0;
} else if (enemy.frameID >= 4 && enemy.frameID <= 36) {
jjOBJ@ obj = jjObjects[enemy.fireBullet(OBJECT::BLASTERBULLET)];
obj.behavior = BEHAVIOR::BULLET;
obj.determineCurAnim(ANIM::PINKPLAT, 1);
obj.killAnim = jjObjectPresets[OBJECT::BOUNCERBULLET].killAnim;
obj.playerHandling = HANDLING::ENEMYBULLET;
obj.bulletHandling = HANDLING::IGNOREBULLET;
obj.lightType = LIGHT::POINT;
obj.xPos = enemy.xPos+72;
obj.yPos = enemy.yPos-12;
obj.xAcc = .12;
int xs = (jjRandom() & 3);
obj.xSpeed = 19;
int ys = (jjRandom() & 6);
obj.ySpeed = ys + 1;
obj.counterEnd = 155;
}
enemy.determineCurFrame();
}
break;
case STATE::DEACTIVATE:
case STATE::KILL:
enemy.delete();
jjAddObject(OBJECT::BLUESPRING, 1*32, 25*32);
jjAddObject(OBJECT::FULLENERGY, 1*32, 24*32);
break;
}
if(enemy.justHit == 0)
{jjDrawSpriteFromCurFrame(enemy.xPos, enemy.yPos, enemy.curFrame, 0, SPRITE::PALSHIFT, -24);}
else enemy.draw();
}
class Cannon : jjBEHAVIORINTERFACE {
void onBehave(jjOBJ@ obj) {
obj.behave(BEHAVIOR::BIGOBJECT, false);
obj.draw();
jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::BIGROCK].curAnim];
anim.frameCount = 1;
jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
jjPIXELMAP rock(0, 32*32, 2*32, 2*32, 5);
rock.save(frame);
frame.hotSpotY = -26;
}
bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ p, int force) {
if(p.charCurr!=CHAR::JAZZ)
{p.morphTo(CHAR::JAZZ, true);}
if (p.charCurr==CHAR::JAZZ && p.keyUp == true && p.direction == -1 && p.keyRight == false && p.keyLeft == false && p.keyFire == false && p.keyDown == false) {
//p.yPos = p.yPos -5;
jjObjects[obj.fireBullet(OBJECT::FIREBALLBULLET)];
//jjAddObject(OBJECT::RFBULLET, obj.xPos, obj.yPos -20);
jjSample(obj.xPos, obj.yPos, SOUND::COMMON_BENZIN1, 1000);
}
if(p.charCurr==CHAR::JAZZ && p.keyDown == true && p.keyLeft == false)
{p.blink = 5;}
return true;
}
}
void CannonBall(jjOBJ@ bullet) {
bullet.xPos = bullet.xPos -5;
bullet.determineCurAnim(ANIM::PINKPLAT, 1);
bullet.determineCurFrame();
bullet.frameID = 19;
++bullet.counter;
bullet.counter += 4;
int xs = (jjRandom() & 8);
bullet.xPos = bullet.xPos - xs -28;
int ys = (jjRandom() & 12);
bullet.yPos = bullet.yPos - ys -13;
if (bullet.counter >200) {
bullet.delete();
int explosionID = jjAddObject(OBJECT::BLASTERBULLET, bullet.xPos, bullet.yPos, bullet.creator, CREATOR::OBJECT);
jjObjects[explosionID].determineCurAnim(ANIM::AMMO, 4, true);
jjObjects[explosionID].state = STATE::EXPLODE;
}
bullet.draw();
}
void onFunction10(jjPLAYER@ p){
if(p.gems[GEM::PURPLE] == 50) {
p.showText("@@@@@You made it!");}
if(p.gems[GEM::PURPLE] < 50) {
p.showText("@@@@@@@Kill the pirates, collect the treasure@and come back here!");}
}
void onMain() {
gem::deleteCollectedGems();
jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::BANANA].curAnim];
anim.frameCount = 1;
jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
jjPIXELMAP pgem(0, 37*32, 2*32, 2*32, 5);
pgem.save(frame);
frame.hotSpotX = -32;
if(jjKey[9] && jjKey[0x51]) {
p.morphTo(CHAR::JAZZ, false);
}
if(jjKey[9] && jjKey[0x57]) {
p.morphTo(CHAR::SPAZ, false);
}
if(jjKey[9] && jjKey[0x45]) {
p.morphTo(CHAR::LORI, false);
}
}
void onLevelReload() {
if(bossdefeated == true)
{jjAddObject(OBJECT::BLUESPRING, 1*32, 25*32);}
gem::restorePlayerGems();
jjLocalPlayers[0].lives++;
jjSetWaterLevel(2027, true);
jjWaterLighting = WATERLIGHT::GLOBAL;
exit = 0;
for (uint i = 0; i < 32; ++i)
jjTriggers[i] = SavedTriggers[i];
}
array<bool> SavedTriggers(32, false);
//Extendable Checkpoints by VioletCLM
void CheckpointWrapper(jjOBJ@ obj) {
if (obj.state == STATE::STOP) {
jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 8);
} else if (obj.state == STATE::DEACTIVATE) { //due to death
obj.deactivate();
} else {
obj.behave(BEHAVIOR::CHECKPOINT);
jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::PALSHIFT, 8);
if (obj.state == STATE::DONE) { //triggered by the player hitting it
obj.state = STATE::STOP;
//save the current state of some properties
for (uint i = 0; i < 32; ++i)
SavedTriggers[i] = jjTriggers[i];
//OPTIONAL: this loop makes checkpoints reusable, so only the most recent checkpoint you touched is ever active
for (int i = jjObjectCount; --i > 0;) {
jjOBJ@ obj2 = jjObjects[i];
if (obj2.eventID == OBJECT::CHECKPOINT && i != obj.objectID && obj2.isActive) {
obj2.state = STATE::SLEEP;
obj2.var[0] = 0;
}
}
}
}
}
jjTEXTAPPEARANCE SignTextAppearance = STRING::NORMAL;
class Sign {
private int xPos, yPos; //These pixel-based positions will be generated from tile-based positions in the constructor by multiplying by 32
private string text;
private uint widthOfText;
Sign(){} //AngelScript requires any class that appears in any array to have an explicit default constructor, even if it's never called
Sign(int xTile, int yTile, const string &in t) {
xPos = xTile * 32; //Since this is a constant operation, it could strictly be performed in the draw method instead of the constructor, but this way involves fewer multiplication instructions
yPos = yTile * 32; //
text = t;
SignTextAppearance.newline = STRING::SPECIALSIGN; //Causes the drawString method to interpret instances of the \n character as signals to drop down to a new line, similar to the special effect of the @ character in the STRING::SPIN appearance.
SignTextAppearance.spacing = -2; //int jjTEXTAPPEARANCE::spacing is new in 5.2, and this particular value is equivalent to prefixing the string with "ยง2". Make sure to check out bool jjTEXTAPPEARANCE::monospace too, though it didn't end up getting used in this level.
widthOfText = jjGetStringWidth(text, STRING::SMALL, SignTextAppearance); //Used for determining how large of a dark rectangle should be drawn behind the text. A matching heightOfText value could of course be generated by counting the number of newline characters--for example, "heightOfText = text.split("\n").length * 20;"--but here the rectangles are constant height instead to limit the temptation to ramble on and on.
}
void draw(jjCANVAS@ layer, uint8 textIntensity) const { //Because this method will be called from an onDraw method, it's important to have a jjCANVAS@ passed among the arguments.
layer.drawRectangle(xPos, yPos - 16, widthOfText + 8, 55, 0, SPRITE::TRANSLUCENT);
layer.drawString(xPos, yPos, text, STRING::SMALL, SignTextAppearance, 0, SPRITE::BLEND_HARDLIGHT, textIntensity);
}
}
const array<Sign> Signs = {
Sign(115, 52, "The ship's under attack\nby the pirate turtles!"),
Sign(91, 52, "Pirates have looted our treasure.\nPlease help us!"),
Sign(180, 21, "We'll be visiting Poseidon once you kill\nthe pirates and save our gems."),
Sign(138, 59, "Rumours say our lost leader Thrasymakhos is\nliving underwater, working on an evil plan!"),
};
void onDrawLayer3(jjPLAYER@, jjCANVAS@ layer) {
if(jjKey[0x54] && exit <50){
const uint8 textIntensity = 200 + int(jjSin(jjGameTicks * 16) * 50);
for (uint signID = 0; signID < Signs.length; ++signID)
Signs[signID].draw(layer, textIntensity);
}
}
bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
return MLLE::WeaponHook.drawAmmo(player, canvas);
}
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.