Collision Check understanding.

0 favourites
  • 3 posts
  • If I set something like this:

    -------------------------------------------

    On "X sprite" collision with "Y sprite == "X sprite" destroy

                                              add 100 to score

    -------------------------------------------

    Is this collision check occurring on "every tick"?

    Because I have a lot of this collision checks, and I was reading on "Performance tips" that this could be a slow down reason, and it recommends to check collisions every second, or every half second, instead of every tick.

  • Yes, it is..

    I can't really tell you any performance tips that won't be in the manual.. It'd be nice to know exactly how the collision checks actually work.

    If you happen to be checking between 2 circular objects, you can simply compare distances instead though.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Collision checks are two tiered - first there's a simple bounding box check, then if there's an overlap, it does a second check using the collision polygons of those picked instances.

    You can reduce the collision checks by setting conditions to filter out some of them beforehand. Such as:

    Sprite.variable=1

    Sprite overlaps sprite2

    • rotate sprite

    Then only the sprite instances with variable=1 are checked, saving performance.

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