1 decade ago by ansimuz
Hi,
What's the best approach to set gravity in the X axis. I am trying to simulate wind forces.
Thanks
What's the best approach to set gravity in the X axis. I am trying to simulate wind forces.
Thanks
This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact
/* Add the ability to be blown by wind to all entities. */
ig.Entity.inject({
affectedByWind: false,
update: function() {
if(this.affectedByWind) {
/* Manipulate velocity here. */
}
this.parent();
}
});
this.vel.x += ig.game.gravity * ig.system.tick * this.gravityFactor;
Quote from ansimuzSounds like you already figured it out.
this.vel.x += ig.game.gravity * ig.system.tick * this.gravityFactor;