Downloads containing hgfBrokenCircuit.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

#include "MLLE-Include-1.4.asc"
const bool MLLESetupSuccessful = MLLE::Setup();
#include "Jazz1Enemies v04.asc"
#pragma require "hgfBrokenCircuit.j2l"

void onLevelLoad()
{
 Jazz1::MakeEnemy(OBJECT::APPLE, Jazz1::Enemies::Tubelectric_BlasterVertical, true, 1.4f, Resize::Method::Scale2xSAI).SetDirection(Jazz1::Directions::Right);
 Jazz1::MakeEnemy(OBJECT::BANANA, Jazz1::Enemies::Tubelectric_BlasterVertical, true, 1.4f, Resize::Method::Scale2xSAI).SetDirection(Jazz1::Directions::Left);
 Jazz1::MakeEnemy(OBJECT::DRAGON, Jazz1::Enemies::Tubelectric_BlasterHorizontal, true, 1.4f, Resize::Method::Scale2xSAI).SetDirection(Jazz1::Directions::Right);
 Jazz1::MakeEnemy(OBJECT::FISH, Jazz1::Enemies::Tubelectric_BlasterHorizontal, true, 1.4f, Resize::Method::Scale2xSAI).SetDirection(Jazz1::Directions::Left);
 Jazz1::MakeEnemy(OBJECT::SPARK, Jazz1::Enemies::Tubelectric_Spark, true, 1.5f, Resize::Method::Scale2xSAI);
 Jazz1::MakeEnemy(OBJECT::NORMTURTLE, Jazz1::Enemies::Diamondus_TurtleGoon, true, 1.2f, Resize::Method::Scale2xSAI).SetDirection(Jazz1::Directions::Random);
 //make trigger crate not despawn
 jjObjectPresets[OBJECT::TRIGGERCRATE].deactivates = false;
}

bool levelClear = false;
void onMain()
{
 uint triggerCount = 0;
 for(int i = 0; i < 4; ++i){
  if(jjTriggers[i] == true)
  {
   triggerCount += 1;
  }
 }
 if(triggerCount == 0)
 {
  jjSlideModChannelVolume(0, 0, 0);
  jjSlideModChannelVolume(2, 0, 0);
  jjSlideModChannelVolume(3, 0, 0);
 }
 if(triggerCount == 1)
 {
  jjSlideModChannelVolume(0, 1, 250);
 }
 if(triggerCount == 2)
 {
  jjSlideModChannelVolume(3, 1, 250);
 }
 if(triggerCount == 3)
 {
  jjSlideModChannelVolume(2, 1, 250);
 }
 if(triggerCount == 4 && levelClear == false)
 {
  levelClear = true;
  jjNxt();
 }
}

void onPlayer(jjPLAYER@ p)
{
 int nearestGem = 999999999;
 float closestGemX = 0;
 float closestGemY = 0;
 float angleToGemRad = 0;
 float angleToGem = 0;
 for(int i = 0; i < jjObjectCount; i++)
 {
  jjOBJ@ o = jjObjects[i];
  int gemDistance = int(sqrt(((o.xPos-p.xPos)**2)+((o.yPos-p.yPos)**2)));
  if(o.eventID == OBJECT::TRIGGERCRATE && o.isActive && gemDistance < nearestGem)
  {
   nearestGem = gemDistance;
   closestGemX = o.xPos;
   closestGemY = o.yPos;
  }
 }
 if(nearestGem < 999999999 && jjDifficulty < 2)
 {
  angleToGemRad = atan2(p.xPos - closestGemX, p.yPos-closestGemY);
  angleToGem = angleToGemRad*162.89;
  jjDrawRotatedSprite(p.xPos+(sin(angleToGemRad+3.14)*48), p.yPos+(cos(angleToGemRad+3.14)*48), ANIM::FLAG, 0, 0, int(angleToGem)+200, 1, 1, SPRITE::TRANSLUCENT, 0, 2, 4);
 }
}

bool onDrawLives(jjPLAYER@ p, jjCANVAS@ canvas)
{
 p.lives = 9;
 return true;
}