Name | Author | Game Mode | Rating | |||||
---|---|---|---|---|---|---|---|---|
Anniversary Bash 17 Levels | Jazz2Online | Multiple | N/A |
void onMain() {
jjTriggers[0] = jjLocalPlayers[0].teamRed;
jjLayerXOffset[2] = jjLayerXOffset[2] + 0.5f;
if (jjLayerXOffset[2] > jjLayerWidth[2] * 32)
jjLayerXOffset[2] = jjLayerXOffset[2] - jjLayerWidth[2] * 32;
jjSetFadeColors(0, 0, 40 + int(20 * jjSin(jjGameTicks * 4)));
}
void onLevelLoad() {
jjObjectPresets[OBJECT::BOUNCERBULLET].behavior = bouncerBullet;
jjObjectPresets[OBJECT::BOUNCERBULLETPU].behavior = bouncerBulletPU;
for (int i = WEAPON::BLASTER; i <= WEAPON::GUN9; i++) {
if (jjWeapons[i].style != WEAPON::POPCORN)
jjWeapons[i].style = WEAPON::CAPPED;
}
}
void bouncerBullet(jjOBJ@ obj) {
obj.behave(BEHAVIOR::BOUNCERBULLET);
preventBouncerFromGoingThroughWalls(obj);
}
void bouncerBulletPU(jjOBJ@ obj) {
obj.behave(BEHAVIOR::BOUNCERBULLETPU);
preventBouncerFromGoingThroughWalls(obj);
}
void preventBouncerFromGoingThroughWalls(jjOBJ@ obj) {
int x = int(obj.xPos), y = int(obj.yPos);
if (jjMaskedPixel(x, y)) {
for (int i = 0;; i++) {
if (!jjMaskedPixel(x - i, y)) {
obj.xPos = x - i - 2;
if (obj.xSpeed > 0)
obj.xSpeed = -obj.xSpeed * 0.875;
if (obj.xAcc > 0)
obj.xAcc = -obj.xAcc;
break;
}
if (!jjMaskedPixel(x + i, y)) {
obj.xPos = x + i + 2;
if (obj.xSpeed < 0)
obj.xSpeed = -obj.xSpeed * 0.875;
if (obj.xAcc < 0)
obj.xAcc = -obj.xAcc;
break;
}
if (!jjMaskedPixel(x, y - i)) {
obj.yPos = y - i;
if (obj.ySpeed > 0)
obj.ySpeed = -obj.ySpeed * 0.875;
break;
}
if (!jjMaskedPixel(x, y + i)) {
obj.yPos = y + i;
if (obj.ySpeed < 0)
obj.ySpeed = -obj.ySpeed * 0.875;
break;
}
}
}
}
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.