Name | Author | Game Mode | Rating | |||||
---|---|---|---|---|---|---|---|---|
A Great Day for Hockey | Lark | Capture the flag | N/A |
const bool MLLESetupSuccessful = MLLE::Setup(); ///@MLLE-Generated
#include "MLLE-Include-1.6.asc" ///@MLLE-Generated
#pragma require "olctoast2024-MLLE-Data-1.j2l" ///@MLLE-Generated
#pragma require "Grove Shrine.j2t" ///@MLLE-Generated
#pragma require "SantasSnowyZone.j2t" ///@MLLE-Generated
#pragma require "Beach.j2t" ///@MLLE-Generated
#pragma require "Town1.j2t" ///@MLLE-Generated
#pragma require "cocacola.j2t" ///@MLLE-Generated
#pragma require "JJ1 Industrius 2005.j2t" ///@MLLE-Generated
#pragma require "Top2.j2t" ///@MLLE-Generated
#pragma require "Damn1.j2t" ///@MLLE-Generated
#pragma require "HotelDeluxefix.j2t" ///@MLLE-Generated
#pragma require "olctoast2024.j2l" ///@MLLE-Generated
#pragma require "jj2coin.wav"
#pragma require "JJ2JMPCAN5.wav"
#pragma require "jj2swish2.wav"
#pragma require "jj2swish.wav"
#pragma require "BUL1.wav"
#pragma require "SPRING1.WAV"
#pragma require "JJ1SKATEPEN.PNG"
void setMaxHealth(int newMaxHealth) {
if (jjIsServer || jjGameConnection == GAME::LOCAL) {
jjChat("/smhealth " + newMaxHealth);
}
}
void onLevelLoad() {
setMaxHealth(2);
jjObjectPresets[OBJECT::FATCHICK].playerHandling = HANDLING::PICKUP;
jjObjectPresets[OBJECT::FATCHICK].behavior = BEHAVIOR::WALKINGENEMY; //just for fun
jjObjectPresets[OBJECT::SEEKERAMMO3].curAnim = jjObjectPresets[OBJECT::DONUT].curAnim; //hockey puck gun
jjObjectPresets[OBJECT::SEEKERAMMO3].special = jjObjectPresets[OBJECT::DONUT].curAnim;
jjPIXELMAP(48).save(jjAnimFrames[jjObjectPresets[OBJECT::DONUT].curFrame]);
jjPIXELMAP(48).save(jjAnimFrames[jjObjectPresets[OBJECT::SEEKERAMMO3].curFrame]);
jjObjectPresets[OBJECT::SEEKERBULLET].freeze = 200;
jjSampleLoad(SOUND::AMMO_GUNJAZZ, "jj2swish2.wav"); //throw coins
jjSampleLoad(SOUND::AMMO_GUN1, "jj2swish2.wav");
jjSampleLoad(SOUND::AMMO_GUN2, "jj2swish2.wav");
jjSampleLoad(SOUND::AMMO_GUN3PLOP, "jj2swish2.wav");
jjObjectPresets[OBJECT::BLASTERBULLET].curAnim = jjObjectPresets[OBJECT::SILVERCOIN].curAnim;
jjObjectPresets[OBJECT::BLASTERBULLET].special = jjObjectPresets[OBJECT::SILVERCOIN].curAnim;
jjObjectPresets[OBJECT::BLASTERBULLET].behavior = BEHAVIOR::BONE;
jjObjectPresets[OBJECT::BOUNCERBULLET].behavior = BEHAVIOR::ROBOTSHARD; //hotdog gun
jjObjectPresets[OBJECT::BOUNCERBULLET].curAnim = jjObjectPresets[OBJECT::WEENIE].curAnim;
jjObjectPresets[OBJECT::BOUNCERBULLET].special = jjObjectPresets[OBJECT::WEENIE].curAnim;
jjObjectPresets[OBJECT::BOUNCERAMMO3].curAnim = jjObjectPresets[OBJECT::WEENIE].curAnim;
jjSampleLoad(SOUND::AMMO_GUNFLP, "bul1.wav");
jjSampleLoad(SOUND::AMMO_GUNFLP1, "bul1.wav");
jjSampleLoad(SOUND::AMMO_GUNFLP2, "bul1.wav");
jjSampleLoad(SOUND::AMMO_GUNFLP3, "bul1.wav");
jjSampleLoad(SOUND::AMMO_GUNFLP4, "bul1.wav");
jjSampleLoad(SOUND::AMMO_GUNFLPL, "bul1.wav");
jjObjectPresets[OBJECT::RFBULLET].curAnim = jjObjectPresets[OBJECT::SOFTDRINK].curAnim; //rf missiles shoot soda
jjObjectPresets[OBJECT::RFAMMO3].curAnim = jjObjectPresets[OBJECT::SOFTDRINK].curAnim;
jjSampleLoad(SOUND::AMMO_LAZRAYS, "JJ2JMPCAN5.wav");
jjSampleLoad(SOUND::AMMO_MISSILE, "SPRING1.wav"); //hockey puck gun
jjObjectPresets[OBJECT::SEEKERBULLET].behavior = BEHAVIOR::COPTER;
jjObjectPresets[OBJECT::SEEKERBULLET].xSpeed = 20;
jjObjectPresets[OBJECT::SEEKERBULLET].curAnim = jjObjectPresets[OBJECT::CHEESE].curAnim;
jjObjectPresets[OBJECT::SEEKERBULLET].special = jjObjectPresets[OBJECT::CHEESE].curAnim;
jjPIXELMAP(48).save(jjAnimFrames[jjObjectPresets[OBJECT::CHEESE].curFrame]);
jjPIXELMAP(48).save(jjAnimFrames[jjObjectPresets[OBJECT::SEEKERBULLET].curFrame]);
jjPIXELMAP("JJ1SKATEPEN.PNG").save(jjAnimFrames[jjObjectPresets[OBJECT::APPLE].curFrame]); //jj1 penguin
jjObjectPresets[OBJECT::APPLE].behavior = BEHAVIOR::WALKINGENEMY;
jjObjectPresets[OBJECT::APPLE].xSpeed = -1.25;
jjObjectPresets[OBJECT::APPLE].playerHandling = HANDLING::ENEMY;
jjObjectPresets[OBJECT::APPLE].isFreezable = true; //freeze the jj1 penguins with the hockey puck gun!
jjObjectPresets[OBJECT::TOASTERBULLET].behavior = BEHAVIOR::COPTER;
jjObjectPresets[OBJECT::TOASTERBULLET].xSpeed = 20;
jjObjectPresets[OBJECT::TOASTERBULLET].ySpeed = -42;
}
class PlayerWallJumpProperties {
uint Stage = 0;
bool FacingRight;
int LastSlidingTick = 0;
bool PressingJumpOneTickAgo = false;
PlayerWallJumpProperties(){}
}
array<PlayerWallJumpProperties> PlayerWallJumpPropertiesArray(jjLocalPlayerCount);
void onPlayer(jjPLAYER@ play) {
p.fastfire = 5;
p.specialMove = 0;
p.buttstomp = 122;
PlayerWallJumpProperties@ wallJumpProperties = @PlayerWallJumpPropertiesArray[play.localPlayerID];
const bool pressingJump = play.keyJump;
if (
pressingJump &&
!wallJumpProperties.PressingJumpOneTickAgo &&
wallJumpProperties.Stage < 2 &&
(jjGameTicks - wallJumpProperties.LastSlidingTick) < 10 //10 = number of ticks after technically letting go of the wall during which you can still start the jump. Higher numbers are more generous.
) {
wallJumpProperties.Stage = 2;
jjSample(play.xPos, play.yPos, SOUND::COMMON_JUMP);
play.ySpeed = play.jumpStrength;
play.helicopter = 0;
play.doubleJumpCount = 0;
} else if (wallJumpProperties.Stage > 1) {
if (++wallJumpProperties.Stage == 20)
wallJumpProperties.Stage = 0;
else {
play.keyRight = wallJumpProperties.FacingRight;
play.keyLeft = !wallJumpProperties.FacingRight;
play.keyJump = true;
play.helicopter = 0;
}
} else {
const auto anim = play.curAnim - jjAnimSets[play.setID];
const int xPosToTest = int(play.xPos) + (play.keyRight ? 13 : -13);
uint16 tileIDToTest;
if (
(anim == RABBIT::FALL || anim == RABBIT::HELICOPTER) &&
(play.keyRight || play.keyLeft) &&
(jjMaskedPixel(xPosToTest, int(play.yPos)-8) && jjMaskedPixel(xPosToTest, int(play.yPos)+8))
//put any additional conditions, e.g. events or tiles you can't slide on, here.
) {
play.helicopter = 0;
wallJumpProperties.Stage = 1;
wallJumpProperties.FacingRight = play.keyLeft;
play.ySpeed = 0.25; //modify as desired if you don't like this sliding speed
play.keyJump = false;
wallJumpProperties.LastSlidingTick = jjGameTicks;
} else if (wallJumpProperties.Stage == 1)
wallJumpProperties.Stage = 0;
}
if (play.invisibility = wallJumpProperties.Stage == 1) { //this works for SP, but for MP you'd probably instead want to give everyone SPRITE::INVISIBLE all the time and draw non-local players in an onMain loop.
if (play.blink == 0 || ((jjRenderFrame >> 2) & 1) == 1) {
const int vDir = !play.antiGrav ? 1 : -1;
jjDrawRotatedSprite(play.xPos - play.direction * 3, play.yPos, play.setID, RABBIT::SKID1, jjGameTicks>>4, 256 * play.direction * vDir, -play.direction, vDir, SPRITE::PLAYER, play.playerID);
}
}
wallJumpProperties.PressingJumpOneTickAgo = pressingJump;
}
class HelpString {
int HelpID = -1;
int Timer = -200;
}
array<HelpString> HelpStrings(jjLocalPlayerCount);
bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
HelpString@ helpString = HelpStrings[player.localPlayerID];
const uint xTile = uint(player.xPos) / 32, yTile = uint(player.yPos) / 32;
if (jjEventGet(xTile,yTile) == AREA::TEXT && jjParameterGet(xTile,yTile, 8,10) == 0) {
const int helpID = jjParameterGet(xTile,yTile, 0,8);
if (helpID >= 100 && helpID <= 115) {
if (helpID - 100 != helpString.HelpID) {
helpString.Timer = jjGameTicks + 70;
helpString.HelpID = helpID - 100;
} else if (helpString.Timer < jjGameTicks) {
helpString.Timer = jjGameTicks;
}
}
}
const int time = helpString.Timer - jjGameTicks;
if (time > -70) {
canvas.drawString(
0x8000 + time * int(abs(time)) / 10,
10,
jjHelpStrings[helpString.HelpID],
STRING::SMALL,
STRING::SPIN,
uint(abs(time)) * 3
);
} else
helpString.HelpID = -1;
return false;
}
void onLevelReload() {
MLLE::ReapplyPalette();
}
//void onRoast(jjPLAYER@ victim, jjPLAYER@ killer) { //warps you to the penalty box (not used)
// if (@killer !is null) killer.warpToID(0);
//}
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.