2.0
10 Jul 2013 16:52
const int cRingLifeTime = 55;
void CreateRing(int objectID) {
int playerID = jjObjects[objectID].creator - 32768;
int ringID = jjAddObject(OBJECT::SMOKERING, jjPlayers[playerID].xPos+(jjPlayers[playerID].direction*48), jjPlayers[playerID].yPos, jjPlayers[playerID].playerID, CREATOR::PLAYER);
jjObjects[ringID].determineCurAnim(ANIM::CATERPIL, 6, true);
jjObjects[ringID].direction = jjPlayers[playerID].direction;
}
void DestroyRing(int ringID) {
int explosionID = jjAddObject(OBJECT::ELECTROBULLET, jjObjects[ringID].xPos, jjObjects[ringID].yPos, jjObjects[ringID].creator, CREATOR::PLAYER);
jjDeleteObject(ringID);
jjObjects[explosionID].determineCurAnim(ANIM::AMMO, 1, true);
jjObjects[explosionID].state = STATE::EXPLODE;
}
void onMain() {
p.ammo[9] = 3;
for(int i = 1; i < jjObjectCount; i++) {
if(jjObjects[i].isActive && jjObjects[i].eventID == OBJECT::SMOKERING) {
jjObjects[i].ySpeed = 0;
jjObjects[i].xPos = jjObjects[i].xPos+(jjObjects[i].direction*10);
if (jjObjects[i].counter > 10) jjDeleteObject(i);
}
}
for (int i = 0; i < jjObjectCount; i++)
if (jjObjects[i].isActive && jjObjects[i].creatorType == CREATOR::PLAYER) {
//Create smokering
if (jjObjects[i].eventID == OBJECT::ELECTROBULLET && jjObjects[i].state != STATE::EXPLODE) {
jjDeleteObject(i);
CreateRing(i);
continue;
}
//Destroy smokering
if (jjObjects[i].eventID == OBJECT::SMOKERING) {
jjObjects[i].age++;
if (jjObjects[i].age > cRingLifeTime)
DestroyRing(i);
continue;
}
}
}
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.