Exemplo n.º 1
0
	public void Walk() {
		this.iCycle++;
		this.angleUppLegL = (((this.angleUppLegMax - this.angleUppLegMin) / 2f) * ((float) Math
				.sin(((((float) this.iCycle) / ((float) this.cycleLength)) * 2f) * 3.1415926535897931)))
				+ ((this.angleUppLegMax + this.angleUppLegMin) / 2f);
		this.angleUppLegR = (((this.angleUppLegMax - this.angleUppLegMin) / 2f) * ((float) Math
				.sin((((((float) this.iCycle) / ((float) this.cycleLength)) * 2f) * 3.1415926535897931) + 3.1415926535897931)))
				+ ((this.angleUppLegMax + this.angleUppLegMin) / 2f);
		this.angleLowLegL = (((this.angleLowLegMax - this.angleLowLegMin) / 2f) * ((float) Math
				.sin((((((float) this.iCycle) / ((float) this.cycleLength)) * 2f) * 3.1415926535897931)
						- (6.2831853071795862 * this.phaseDelay))))
				+ ((this.angleLowLegMax + this.angleLowLegMin) / 2f);
		this.angleLowLegR = (((this.angleLowLegMax - this.angleLowLegMin) / 2f) * ((float) Math
				.sin(((((((float) this.iCycle) / ((float) this.cycleLength)) * 2f) * 3.1415926535897931) + 3.1415926535897931)
						- (6.2831853071795862 * this.phaseDelay))))
				+ ((this.angleLowLegMax + this.angleLowLegMin) / 2f);
		this.position.x += this.speed;
		float num = (((float) (Math.cos((double) this.angleUppLegL) + Math
				.cos((double) this.angleLowLegL))) < ((float) (Math
				.cos((double) this.angleUppLegR) + Math
				.cos((double) this.angleLowLegR)))) ? ((float) (this.t2DUpperLeg.getHeight() * (Math
				.cos((double) this.angleUppLegL) + Math
				.cos((double) this.angleLowLegL))))
				: ((float) (this.t2DUpperLeg.getHeight() * (Math
						.cos((double) this.angleUppLegR) + Math
						.cos((double) this.angleLowLegR))));
		this.position.y = this.positionGround.y - num;
		this.angleUppArmL = (((this.angleUppArmMax - this.angleUppArmMin) / 2f) * ((float) Math
				.sin(((((float) this.iCycle) / ((float) this.cycleLength)) * 2f) * 3.1415926535897931)))
				+ ((this.angleUppArmMax + this.angleUppArmMin) / 2f);
		this.angleUppArmR = (((this.angleUppArmMax - this.angleUppArmMin) / 2f) * ((float) Math
				.sin((((((float) this.iCycle) / ((float) this.cycleLength)) * 2f) * 3.1415926535897931) + 3.1415926535897931)))
				+ ((this.angleUppArmMax + this.angleUppArmMin) / 2f);
		this.angleLowArmL = (((this.angleLowArmMax - this.angleLowArmMin) / 2f) * ((float) Math
				.sin((((((float) this.iCycle) / ((float) this.cycleLength)) * 2f) * 3.1415926535897931)
						+ (6.2831853071795862 * this.phaseDelay))))
				+ ((this.angleLowArmMax + this.angleLowArmMin) / 2f);
		this.angleLowArmR = (((this.angleLowArmMax - this.angleLowArmMin) / 2f) * ((float) Math
				.sin(((((((float) this.iCycle) / ((float) this.cycleLength)) * 2f) * 3.1415926535897931) + 3.1415926535897931)
						+ (6.2831853071795862 * this.phaseDelay))))
				+ ((this.angleLowArmMax + this.angleLowArmMin) / 2f);
		this.upperArmL.angle = -this.angleUppArmL;
		this.upperArmR.angle = -this.angleUppArmR;
		this.lowerArmL.angle = -this.angleLowArmL;
		this.lowerArmR.angle = -this.angleLowArmR;
		this.upperLegL.angle = -this.angleUppLegL;
		this.upperLegR.angle = -this.angleUppLegR;
		this.lowerLegL.angle = -this.angleLowLegL;
		this.lowerLegR.angle = -this.angleLowLegR;
		this.torso.angle = (0.08246681f * ((float) Math
				.sin(((((float) this.iCycle) / ((float) this.cycleLength)) * 2f) * 3.1415926535897931))) + 0.1090831f;
		for (BodyPart part : this.bodyPartList) {
			part.Update();
		}
		if (this.iCycle >= this.cycleLength) {
			this.iCycle = 0;
		}
	}