Downloads containing pinball2k15.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Anniversary Bash 20 Levels Jazz2Online Multiple N/A Download file
TSF with JJ2+ Only: Pinball Arena 2k15Featured Download Blackraptor Capture the flag 9.2 Download file
TSF with JJ2+ Only: Anniversary Bash 17 Levels Jazz2Online Multiple N/A Download file

File preview

 bool killed = false;
 
 
 bool playerInDeathRoom(jjPLAYER@ play) {
  return play.xPos > 155*32 &&
         play .xPos <= 178*32 &&
         play.yPos > 70*32 &&
         play.yPos <= 84*32;
}
 
bool lasersOn() {
        return jjMaskedHLine(155*32, 32, 78*32);
}
 
 
 void onLevelLoad() {
 
        jjTexturedBGStyle = TEXTURE::TILEMENU;
 
 }
 
void onMain(){
  jjOBJ@ obj;
  for(int i=0;i<jjObjectCount;i++)
    {
    @obj=jjObjects[i];
    if(!obj.isActive) {continue;}
        switch(obj.eventID)
         {
        case OBJECT::GUN8AMMO3:
            if(obj.xPos > 82*32 && obj.xPos < 91*32) {
                obj.xPos=86*32+64*jjSin(jjGameTicks*5+obj.xOrg*32/3);
                obj.yPos=75*32+64*jjCos(jjGameTicks*5+obj.xOrg*32/3);
                obj.xSpeed=obj.ySpeed=0;
                obj.determineCurAnim(ANIM::AMMO,61);
                if(jjGameTicks%7==0) {createExplosion(obj.xPos,obj.yPos,ANIM::AMMO,12);}
                  } else if(obj.xPos > 131*32 && obj.xPos < 145*32) {
                obj.xPos=139*32+64*jjSin(jjGameTicks*5+obj.xOrg*32/3);
                obj.yPos=81*32+64*jjCos(jjGameTicks*5+obj.xOrg*32/3);
                obj.xSpeed=obj.ySpeed=0;
                obj.determineCurAnim(ANIM::AMMO,61);
                if(jjGameTicks%7==0) {createExplosion(obj.xPos,obj.yPos,ANIM::AMMO,12);}
				} else if(obj.xPos > 146*32 && obj.xPos < 155*32) {
                obj.xPos=151*32+64*jjSin(jjGameTicks*5+obj.xOrg*32/3);
                obj.yPos=81*32+64*jjCos(jjGameTicks*5+obj.xOrg*32/3);
                obj.xSpeed=obj.ySpeed=0;
                obj.determineCurAnim(ANIM::AMMO,61);
                if(jjGameTicks%7==0) {createExplosion(obj.xPos,obj.yPos,ANIM::AMMO,12);}
				 } else if(obj.xPos > 178*32 && obj.xPos < 188*32) {
                obj.xPos=182*32+64*jjSin(-jjGameTicks*5+obj.xOrg*32/3);
                obj.yPos=81*32+64*jjCos(-jjGameTicks*5+obj.xOrg*32/3);
                obj.xSpeed=obj.ySpeed=0;
                obj.determineCurAnim(ANIM::AMMO,61);
                if(jjGameTicks%7==0) {createExplosion(obj.xPos,obj.yPos,ANIM::AMMO,12);}
				 } else if(obj.xPos > 189*32 && obj.xPos < 197*32) {
                obj.xPos=194*32+64*jjSin(-jjGameTicks*5+obj.xOrg*32/3);
                obj.yPos=81*32+64*jjCos(-jjGameTicks*5+obj.xOrg*32/3);
                obj.xSpeed=obj.ySpeed=0;
                obj.determineCurAnim(ANIM::AMMO,61);
                if(jjGameTicks%7==0) {createExplosion(obj.xPos,obj.yPos,ANIM::AMMO,12);}
				 } else if(obj.xPos > 240*32 && obj.xPos < 255*32) {
                obj.xPos=247*32+64*jjSin(-jjGameTicks*5+obj.xOrg*32/3);
                obj.yPos=75*32+64*jjCos(-jjGameTicks*5+obj.xOrg*32/3);
                obj.xSpeed=obj.ySpeed=0;
                obj.determineCurAnim(ANIM::AMMO,61);
                if(jjGameTicks%7==0) {createExplosion(obj.xPos,obj.yPos,ANIM::AMMO,12);}
				}
                               
        //case OBJECT::GUN8AMMO3:
    //    obj.xPos=139.5*32+64*jjSin(jjGameTicks*5+obj.xOrg*32/4);
    //    obj.yPos=82.5*32+64*jjCos(jjGameTicks*5+obj.xOrg*32/4);
    //    obj.xSpeed=obj.ySpeed=0;
    //    obj.determineCurAnim(ANIM::AMMO,63);
       // if(jjGameTicks%7==0) {createExplosion(obj.xPos,obj.yPos,ANIM::AMMO,63);}
    //    break;
        //case OBJECT::GUN8AMMO3:
    //    obj.xPos=150.5*32+64*jjSin(jjGameTicks*5+obj.xOrg*32/4);
    //   obj.yPos=81.5*32+64*jjCos(jjGameTicks*5+obj.xOrg*32/4);
    //    obj.xSpeed=obj.ySpeed=0;
    //    obj.determineCurAnim(ANIM::AMMO,63);
       // if(jjGameTicks%7==0) {createExplosion(obj.xPos,obj.yPos,ANIM::AMMO,63);}
    //    break;
            }
                        }
 
 
  if(lasersOn() && jjGameTicks % 2 == 0) {
        makeSpark(177*32,78*32);
        makeSpark(156*32,78*32);
        makeSpark(166*32,82*32);
        makeSpark(162*32,80*32);
        makeSpark(171*32,80*32);
        makeSpark(177*32,71*32,true);
        makeSpark(156*32,71*32,true);
        makeSpark(163*32,75*32,true);
        makeSpark(170*32,75*32,true);
  }
 
 
  jjPLAYER@ play = jjLocalPlayers[0];
  if(playerInDeathRoom(play))   {
     if(lasersOn() && !killed) {
        if(jjGameTicks % 30 == 0) {
                        play.hurt(1,true);
                        if(play.health == 0)
                                killed = true;
                }
     }
  } else
        killed = false;
 }
 
void onPlayer(){
  p.powerup[WEAPON::GUN8]=p.powerup[WEAPON::GUN8]=true;
  }
 
  void createExplosion(float x,float y,ANIM::Set set,uint8 anim){
  int ID=jjAddObject(OBJECT::EXPLOSION,x,y);
  jjObjects[ID].determineCurAnim(set,anim);
  }
 
  void onFunction5(jjPLAYER@ p, bool offset) {
        p.antiGrav = offset;
        }
       
void Spark(jjOBJ@ spark) {
        spark.age++;
        spark.xPos = spark.xPos + spark.xSpeed;
        spark.yPos = spark.yPos + spark.ySpeed;
        if(spark.doesHurt == 0)
                spark.ySpeed = spark.ySpeed + 0.1;
        else
                spark.ySpeed = spark.ySpeed - 0.1;
        if(spark.age > 103)
                spark.delete();
        spark.determineCurFrame();
        spark.draw();
}
       
void makeSpark(float xPos, float yPos, bool up=false) {
        float ySpeed;
        if(up)
                ySpeed = (float(jjRandom() % 9000)-6500)/1000;
        else
                ySpeed = (float(jjRandom() % 9000)-3500)/1000;
 
        int ID=jjAddObject(OBJECT::EXPLOSION,xPos,yPos);
        jjObjects[ID].determineCurAnim(ANIM::AMMO,12);
        jjObjects[ID].xPos = xPos;
        jjObjects[ID].yPos = yPos + 12;
        jjObjects[ID].xSpeed = jjRandom() % 2 == 0 ? 1.5 : -1.5;
        jjObjects[ID].ySpeed = ySpeed;
        jjObjects[ID].doesHurt = up ? 1 : 0;
        jjObjects[ID].behavior = Spark;
 }
 
 void onFunction7(jjPLAYER@ player) {
	player.showText("@@@This mighty web we've spun can save us@From all the weight above...@But who avoids the hands of time?@I pray its yours and mine@Your life has only just begun and what we have@Can never be undone@I know there's pieces you must find,@You're out of sight but not out of mind...");
	}