Optimisation Question - RE Collisions

Get help using Construct 2

Post » Thu Feb 25, 2016 11:04 pm

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 :)
Posts: 34
Reputation: 525

Post » Fri Feb 26, 2016 5:31 am

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!
Mistakes were made.
Posts: 1,579
Reputation: 60,299

Return to How do I....?

Who is online

Users browsing this forum: Magistross, mtnboy22, Rable and 6 guests