Inconsistent Bouncing

  • While experimenting with the "bouncing bullets" example I noticed that the bullets do not "bounce"(or deflect) in a consistent direction. At times it looks as though the bullet is not colliding with the "block" at the same point in its travel toward the block(distance from block) despite leaving the player in the same position...perhaps this has something to do with the varying "bounce" behavior?...but then why would it collide at a different point?

    Whatever the cause, I am wondering how I can fix the inconsistency. I know many questions have been asked regarding the "bouncing" behavior but I have yet to find an answer that satisfies my needs...or maybe I'm just too much of a noob to SEE the answer.

    Thanks for any help you can offer.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The problem lies in the fact that a bullet will move with respect to dt. dt will change all the time by tiny amounts, which means the bullets will move different distances every tick. If the speed of the bullet is high, it will move farther every tick.

    The bullet will register its collision with a wall only once a tick. So, every bullet will probably move a different distance 'into the wall' before it executes the bounce code. This will give naturally inconsistent bouncing if you are at an angle.

    There's not much you can do, apart from using physics with 'framerate independent' set to off.

  • Thank you very much for the response...I suspected it might be due to something like that.

    I wondered if perhaps I could make use of something similar to the laser set up in:

    scirra.com/construct2/demos/cant-turn-it-off

    I'm not sure if I could modify that "laser" to be a moving object or a series of moving objects that die when colliding with a wall but at the same time spawn a new object of same type at the appropriate angle to achieve the "bounce" effect.

    As I said, I am new at this and just trying to see what I can do with it...still have lots to learn, no doubt.

    Thanks again.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)