Optimisation Question - RE Collisions

0 favourites
  • 2 posts
  • Hi Guys

    I have a condition

    If PlayerObject -> collision with BulletObject Do....

    However assuming i have 40 BulletObjects on my layout at one time, but lets say only 5 on screen at one time should I improve this adding ..

    If BulletObject onscreen.

    (sub condition) If PlayerObject -> collision with BulletObject Do....

    Basicly does this process add additional checks to see if objects are on screen now, or does it improve the speed as it now only checks for player collisions when they are on screen?

    thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That might be better, as collisions are able to occur off screen.

    On the other hand, it would make sense to me that in your case only the player object needs to check for collisions anyway, so it wouldn't matter how many bullets you have on or off screen. I'm not sure about this though.

    The best way is just to try it yourself and see if it makes a noticeable difference in your frame rate. If it doesn't, don't bother worrying about it!

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