Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by spacelime

I've noticed that the higher gravity, the faster the entity moves downhill and the slower it moves uphill. I want my entity to always move at the same speed in the x axis, how can I accomplish this?

1 decade ago by Joncom

First get your gravity correct. Check.
Then set .vel.x manually.

1 decade ago by spacelime

How can I make sure that it's completely set manually? Now I set it like this:

update: function() 
  {
    // move left or right
    //
    if( ig.input.state('left')) {
      this.vel.x = -this.speed;
     
    }
    else if( ig.input.state('right') ) {
      this.vel.x = +this.speed;


    }

this.parent();
}


Page 1 of 1
« first « previous next › last »