eBullet means Enemy Bullet, so pBullet is Player Bullet
This functions are in a static class(GLOBALS) and works only when i want:
CHECKeBulletPlayerCollisions();
CHECKpBulletEnemyCollisions();
And this functions are in World class’ Update function:
if (classFirst(pBullet) != null && classFirst(Enemy) != null)
{
GLOBALS.CHECKpBulletEnemyCollisions();
}
if (classFirst(eBullet) != null && classFirst(Player) != null)
{
GLOBALS.CHECKeBulletPlayerCollisions();
}
Now my game performance unbelievable for my netbook!
Other way, all the bullets checking collision for enemy instances. Now it is looking like the same thing with a small difference, but i think i got it now, it is not a small difference.
When bullets checking collision they own, each bullet creating an array of enemy instances inside each one of them. But when it is a single collision function, only there are 2 arrays for 2 entity types.