Hello!
In Phaser ( particularly Phaser CE ) I can't find something like Wind Resistance for objects. And start thinking how to implement my own version:
create(){
game.physics.startSystem(Phaser.Physics.P2JS);
game.physics.p2.gravity.y = 100;
this.car = game.add.sprite(32, 32, "car");
game.physics.p2.enable(this.car,false);
this.car.body.windResistance = 0.4;
}
update(){
if(this.car.body.windResistance && this.car.body.velocity.y > this.car.body.windResistance ){
this.car.body.velocity.y-= this.car.body.windResistance;
}
}
With this I can't use big numbers for windResistance, only between 0 and 1.
What do you guys think??