| Name | Author | Game Mode | Rating | |||||
|---|---|---|---|---|---|---|---|---|
| Original Levels - Stone... | ShaddowBlack0 | Single player | 7 | |||||
#include "Resize v10.asc"
#pragma require "nyancat.bmp"
#pragma offer "nyan.wav"
#pragma name "Nyan Rush"
ANIM::Set NYANCAT;
void onLevelLoad() {
TrueColor::ProcessPalette();
TrueColor::EnableCaching();
TrueColor::Bitmap spriteSheet("nyancat.bmp");
jjPALCOLOR background = spriteSheet.pixels[0][0];
jjPALCOLOR transparent = jjPALCOLOR(0,0,0);
for(uint i = 0; i < spriteSheet.width; i++) {
for(uint j = 0; j < spriteSheet.height; j++) {
if(spriteSheet.pixels[i][j] == background) {
spriteSheet.pixels[i][j] = transparent;
}
}
}
array<array<TrueColor::Coordinates>> coordArray2 = {
{
TrueColor::Coordinates(2,12,37,22,-15,-10),
TrueColor::Coordinates(48,10,40,24,-15,-10),
TrueColor::Coordinates(96,11,36,22,-15,-10),
TrueColor::Coordinates(138,11,37,23,-15,-10),
TrueColor::Coordinates(181,11,36,22,-15,-10),
TrueColor::Coordinates(220,11,36,22,-15,-10)
}
};
NYANCAT = TrueColor::FindCustomAnim();
int NUM_ANIMS = 1;
int NUM_SPRITES = 6;
int WIDTH = 40;
array<array<TrueColor::Coordinates>> coordArray(NUM_ANIMS, array<TrueColor::Coordinates>(NUM_SPRITES));
for(int i = 0; i < NUM_ANIMS; i++) {
for(int j = 0; j < NUM_SPRITES; j++) {
coordArray[i][j] = TrueColor::Coordinates(j*WIDTH, 11, 45, 25);
}
}
Resize::AllocateAndResizeTrueColorSpriteSheet(NYANCAT, spriteSheet, coordArray2, 2);
}
void onLevelBegin() {
jjSampleLoad(SOUND::RUSH_RUSH, "nyan.wav");
}
bool isCat = false;
array<bool> isRush(32);
bool isAnim(jjPLAYER@ play, RABBIT::Anim anim) {
return play.curAnim - jjAnimSets[play.setID].firstAnim == uint(anim);
}
bool isStomp(jjPLAYER@ play) {
return isAnim(play, RABBIT::BUTTSTOMPLAND) || isAnim(play, RABBIT::FALLBUTTSTOMP) || isAnim(play, RABBIT::FALLLAND) || isAnim(play, RABBIT::FALL);
}
void onMain() {
if(jjIsServer) {
for(int i = 0; i < 32; i++) {
if(jjPlayers[i].getObjectHitForce() == 1 && !isStomp(jjPlayers[i])) {
isRush[i] = true;
jjDebug("CASE1");
} else if(isRush[i] && isStomp(jjPlayers[i])) {
isRush[i] = true;
jjDebug("CASE2");
} else {
isRush[i] = false;
}
}
for(int i = 0; i < 32; i++) {
if(isRush[i]) {
jjPlayers[i].invisibility = true;
} else {
jjPlayers[i].invisibility = false;
}
}
}
for(int i = 0; i < 32; i++) {
if(jjPlayers[i].invisibility == true) {
jjTEXTAPPEARANCE style(STRING::NORMAL);
style.align = STRING::CENTER;
jjDrawString(jjPlayers[i].xPos+2,jjPlayers[i].yPos-27," 1" + jjPlayers[i].name, STRING::SMALL, style, 0, SPRITE::NORMAL, 0, 1);
TrueColor::DrawSprite(jjPlayers[i].xPos,jjPlayers[i].yPos,NYANCAT,0,(jjGameTicks >> 3) * TrueColor::NumberOfFramesPerImage, jjPlayers[i].direction);
particle(jjPlayers[i], -18, 24);
particle(jjPlayers[i], -11, 43);
particle(jjPlayers[i], -4, 40);
particle(jjPlayers[i], 4, 19);
particle(jjPlayers[i], 11, 35);
particle(jjPlayers[i], 18, 93);
}
}
}
void particle(jjPLAYER@ player, int yOffset, int color) {
jjPARTICLE@ part = jjAddParticle(PARTICLE::STAR);
int xOffset = 15;
int dir = (player.direction < 0 ? 1 : -1);
xOffset = xOffset * dir;
part.xPos = player.xPos + xOffset;
part.yPos = player.yPos + yOffset + (jjSin((jjGameTicks % 35) * (1024/35))-0.5)*5;
part.xSpeed = dir * 5;
part.star.size = 12;
part.star.color = color;
}
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.