Downloads containing hgfDiamondusColosseum.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Operation Cleanup: Turtle...Featured Download happygreenfrog Single player 8.2 Download file

File preview

#pragma require "hgfDiamondusColosseum.j2l"
#include "Jazz1Enemies v04.asc"

void onLevelLoad()
{
 //select enemies
 Jazz1::MakeEnemy(OBJECT::NORMTURTLE, Jazz1::Enemies::Diamondus_TurtleGoon, true, 1.2f, Resize::Method::Scale2xSAI).SetDirection(Jazz1::Directions::FaceJazz);
 //Jazz1::MakeEnemy(OBJECT::BEE, Jazz1::Enemies::Diamondus_BumblingBee, true, 1.3f, Resize::Method::Scale2xSAI);
 Jazz1::MakeEnemy(OBJECT::SPARK, Jazz1::Enemies::Tubelectric_Spark, true, 1.5f, Resize::Method::Scale2xSAI);
}

//initialize variables
int enemySpawnDelay = 120/(jjDifficulty+1);
int enemyKillCount = 0;
void onMain()
{
 enemySpawnDelay -= 1;
 if(enemySpawnDelay <= 0)
 {
  for(int ply = 0; ply < jjPlayerCount; ++ply)
  {
   //prepare type selection
   int enemyType = 0;
   
   //select type
   if(enemyKillCount < 6){enemyType = jjRandom() % 2;}
   //select from more types
   if(enemyKillCount >= 6 && enemyKillCount < 35){enemyType = jjRandom() % 4;}
   if(enemyKillCount >= 20){enemyType = jjRandom() % 6;}
   
   //set player variable
   jjPLAYER@ p = jjPlayers[ply];
   
   //validate spawn locations
   float spawnLeftX = p.xPos-(jjSubscreenWidth/2)-64;
   if(spawnLeftX < 16){spawnLeftX = 16;}
   float spawnRightX = p.xPos+(jjSubscreenWidth/2)+64;
   if(spawnRightX > 2000){spawnRightX = 2000;}

   //spawn turtle
   if(enemyType == 0){jjAddObject(OBJECT::NORMTURTLE, spawnLeftX, 0);}
   if(enemyType == 1){jjAddObject(OBJECT::NORMTURTLE, spawnRightX, 0);}

   //spawn bee
   if(enemyType == 2){jjAddObject(OBJECT::BEE, spawnLeftX, p.yPos-64);}
   if(enemyType == 3){jjAddObject(OBJECT::BEE, spawnRightX, p.yPos-64);}
   
   //spawn spark
   if(enemyType == 4){jjAddObject(OBJECT::SPARK, spawnLeftX+32, p.yPos+64);}
   if(enemyType == 5){jjAddObject(OBJECT::SPARK, spawnRightX-32, p.yPos+64);}
   
   //reset cooldown
   if(enemyKillCount < 13){enemySpawnDelay = (140-(enemyKillCount*3))/(jjDifficulty+1);}
   
   //reset cooldown to lower amount of time
   if(enemyKillCount >= 13){enemySpawnDelay = 70/(jjDifficulty+1);}
  }
 }
 //count killed enemies
 //loop objects
 for(int i = 0; i < jjObjectCount; ++i)
 {
  //set object
  jjOBJ@ o = jjObjects[i];
  //if object is HURTBYBULLET and in KILL state, set var 11 (which SEEMS to be unused by the enemies I'm using) to 888888 and add 1 to kill count
  if(o.state == STATE::KILL && o.var[11] != 888888)
  {
   enemyKillCount += 1;
   o.var[11] = 888888;
  }
 }
 
 //clear stage
 if(enemyKillCount >= 55)
 {
  jjNxt();
  enemyKillCount = -9001;
 }
 //easy mode victory
 if(enemyKillCount >= 35 && jjDifficulty == 0)
 {
  jjNxt();
  enemyKillCount = -9001;
 }
}

//infinite lives, render enemies remaining to screen
bool onDrawLives(jjPLAYER@ p, jjCANVAS@ canvas)
{
 p.lives = 9;
 if(jjDifficulty > 0)
 {
  canvas.drawString(p.subscreenX+4, p.subscreenY+jjSubscreenHeight-16, enemyKillCount+"/55", STRING::MEDIUM);
 }
 if(jjDifficulty == 0)
 {
  canvas.drawString(p.subscreenX+4, p.subscreenY+jjSubscreenHeight-16, enemyKillCount+"/35", STRING::MEDIUM);
 }
 return true;
}

void onFunction0(jjPLAYER@ p)
{
 p.showText(jjDifficulty, 0);
}

void onLevelReload()
{
 enemyKillCount = 0;
}