Is there a way to have Gravity affect elements in diferent directions, for example this game
colour-bind where blue objects fall upwards and red objects fall to the bottom while green objects fall to the right...
Is there a way in Impact to change gravity direction?
Thank you
If all you want is multi-direction axis-aligned gravity, best is to, in your ig.Entity subclass, overwrite the update method and not invoke its parent's, paying attention to & customizing this line:
this.vel.y += ig.game.gravity * ig.system.tick * this.gravityFactor;
and adding same for vel.x.
If OTOH you want non-axis-aligned gravity, you may want to check out this
localGravity plugin I wrote a while back.
Hi Hazneliel did you find a way to implement this? I need a similar way to simulate gravity from multiple directions but I haven't been able to figure it out.
@alexandre: maybe you can provide me with a simple example?
@boomshanka sorry I've been away these past few days.
More info on the local-gravity plugin
here .
Let me know if any of the instructions are unclear.
Cheers.
Page 1 of 1
« first
« previous
next ›
last »