Downloads containing flight.mut

Downloads
Name Author Game Mode Rating
JJ2+ Only: Rocket FlightFeatured Download szmol96 Mutator 9.4 Download file

File preview

#pragma name "Rocket Flight"
#pragma require "flight.j2a"

/**Rocket Flight**/
/**Author: szmol96**/

int fuel = 140; //Time left for flying. Set this together with fuelMax. 
const int fuelMax = 140; //How long the player is able to fly. Currently set to 2 seconds.(140/70=2)
bool jumpHeld;
bool flying = false;

void onPlayerInput(jjPLAYER@ p) {
	if (!jjMaskedHLine(p.xPos - 12, 24, p.yPos + 21) && p.keyJump && !jumpHeld) {
		flying = true;
	}

	if (p.keyJump && fuel > 0 && flying) {
		p.ySpeed = p.ySpeed - .5;
		fuel--;
				
		if (jjGameTicks% 3 == 0) jjSample(p.xPos, p.yPos, SOUND::BILSBOSS_FIRE, 0, 20000);
		
		jjPARTICLE@ flame1 = jjAddParticle(PARTICLE::FIRE);
			if (flame1 !is null) {
			flame1.fire.colorStop = 46;
			flame1.fire.colorDelta = 2;
			flame1.xPos = p.xPos;
			flame1.yPos = p.yPos + 25;
			flame1.ySpeed = 1.5;
		}
		jjPARTICLE@ flame2 = jjAddParticle(PARTICLE::FIRE);
			if (flame2 !is null) {
			flame2.fire.colorStop = 46;
			flame2.fire.colorDelta = 2;
			flame2.xPos = p.xPos - 3;
			flame2.yPos = p.yPos + 25;
			flame2.ySpeed = 1;
		}
		jjPARTICLE@ flame3 = jjAddParticle(PARTICLE::FIRE);
			if (flame3 !is null) {
			flame3.fire.colorStop = 46;
			flame3.fire.colorDelta = 2;
			flame3.xPos = p.xPos + 3;
			flame3.yPos = p.yPos + 25;
			flame3.ySpeed = 1;
		}
		jjPARTICLE@ flame4 = jjAddParticle(PARTICLE::FIRE);
			if (flame4 !is null) {
			flame4.fire.colorStop = 46;
			flame4.fire.colorDelta = 2;
			flame4.xPos = p.xPos + 6;
			flame4.yPos = p.yPos + 25;
			flame4.ySpeed = .5;
		}
		jjPARTICLE@ flame5 = jjAddParticle(PARTICLE::FIRE);
			if (flame5 !is null) {
			flame5.fire.colorStop = 46;
			flame5.fire.colorDelta = 2;
			flame5.xPos = p.xPos - 6;
			flame5.yPos = p.yPos + 25;
			flame5.ySpeed = .5;
		}
	}
	jumpHeld = p.keyJump;
}

void onPlayer(jjPLAYER@ p) {
	jjCharacters[CHAR::JAZZ].airJump = AIR::NONE;
	jjCharacters[CHAR::SPAZ].airJump = AIR::NONE;
	jjCharacters[CHAR::LORI].airJump = AIR::NONE;
	
	if (jjMaskedHLine(p.xPos - 12, 24, p.yPos + 21)) {
		fuel = fuelMax;
		flying = false;
	}
}