Downloads containing ac.asc

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Anniversary Bash 19 Levels Jazz2Online Multiple N/A Download file

File preview

//...............ThunDerius...............//
array<AC> ACs;

class AC {
	int xPos;
	int yPos;
	int style;
	int size;
	int counter;
	uint gen;
	array<array<int>> objs;
	OBJECT::Object ammo;
}

void addAC (int xTile, int yTile, int style, uint num, uint size, uint gen, OBJECT::Object ammo) {
	AC ac;
	ac.xPos = xTile*32;
	ac.yPos = yTile*32;
	ac.style = style;
	ac.gen = gen*70;
	ac.size = size;
	for (uint i=0; i < num;i++) {
	  array<int> sBs;
	  sBs.insertLast(0);
	  sBs.insertLast(0);
	  ac.objs.insertLast(sBs);
	}
	ac.ammo = ammo;
	ACs.insertLast(ac);
}

void AC_SETTING () {
	for (uint r=0; r < ACs.length;r++) {
		AC@ ac = ACs[r];
		ac.counter += 3;
		for (uint i=0; i < ac.objs.length;i++) {
			if (!jjObjects[ac.objs[i][0]].isActive) {
			    if (ac.objs[i][1] == 0) {
			       int w = jjAddObject(ac.ammo,ac.xPos, ac.yPos, 0, CREATOR::LEVEL);
			       ac.objs[i][0] = w;
			       jjOBJ@ o = jjObjects[w];
			       o.behavior = BEHAVIOR::CP;
				   ac.objs[i][1] = ac.gen;
			    } else {
					ac.objs[i][0] = 0;
					ac.objs[i][1]--;
				}
			} 
		}
	}
}

void CP(jjOBJ@ obj) {
	obj.draw();
	obj.frameID = (jjGameTicks/4) & 7;
	obj.determineCurFrame(true);
	for (uint r=0; r < ACs.length;r++) {
		AC@ ac = ACs[r];
		for (uint i=0; i <ac.objs.length;i++) {
			if (obj.objectID == ac.objs[i][0]) {
	          obj.xPos = obj.xOrg + jjSin(ac.counter+(200*(i)/(ac.objs.length))*5)*ac.size;
	          obj.yPos = obj.yOrg + jjCos(ac.counter+(200*(i)/(ac.objs.length))*5)*ac.size;
			  if (jjGameTicks%15 == 0) {
				  int x = jjAddObject(OBJECT::EXPLOSION,obj.xPos, obj.yPos, 0, CREATOR::LEVEL);
				  jjOBJ@ o = jjObjects[x];
			       switch (ac.style) {
				      case 1 : 
		              o.determineCurAnim(ANIM::AMMO, 6, true); break;
				      case 2 : 
				      o.determineCurAnim(ANIM::AMMO, 7, true); break;
					  case 3 :
					  o.determineCurAnim(ANIM::AMMO, 2, true); break;
					  case 4 :
					  o.determineCurAnim(ANIM::AMMO, 3, true); break;
					  case 5 :
					  o.determineCurAnim(ANIM::AMMO, 4, true); break;
					  case 6 :
					  o.determineCurAnim(ANIM::AMMO, 5, true); break;
					  case 7 :
					  o.determineCurAnim(ANIM::AMMO, 70, true); break;
					  case 8 :
					  o.determineCurAnim(ANIM::AMMO, 71, true); break;
					  case 9 :
					  o.determineCurAnim(ANIM::AMMO, 72, true); break;
					  case 10 :
					  o.determineCurAnim(ANIM::AMMO, 75, true); break;
					  case 11 :
					  o.determineCurAnim(ANIM::AMMO, 81, true); break;
					  case 12 :
					  o.determineCurAnim(ANIM::AMMO, 82, true); break;
			        }
			    }
			}
		}
	}
}