MBHaxe/src/shapes/SuperJump.hx
2021-06-07 23:25:36 +05:30

27 lines
821 B
Haxe

package shapes;
import src.DtsObject;
class SuperJump extends PowerUp {
public function new() {
super();
this.dtsPath = "data/shapes/items/superjump.dts";
this.isCollideable = false;
this.isTSStatic = false;
this.identifier = "SuperJump";
}
public function pickUp():Bool {
return this.level.pickUpPowerUp(this);
}
public function use(time:Float) {
var marble = this.level.marble;
marble.velocity = marble.velocity.add(this.level.currentUp.multiply(20));
// marble.body.addLinearVelocity(this.level.currentUp.scale(20)); // Simply add to vertical velocity
// if (!this.level.rewinding)
// AudioManager.play(this.sounds[1]);
// this.level.particles.createEmitter(superJumpParticleOptions, null, () => Util.vecOimoToThree(marble.body.getPosition()));
// this.level.deselectPowerUp();
}
}