transition performance question

Oh, and as for the collision detection, you may also run into issues there. Read through https://docs.coronalabs.com/guide/physics/collisionDetection/index.html.

It really depends on what type of collisions you are interested in. If you are just looking at if an enemy collides with the player character, then you’ll want to go with the local collision handling. Physics can get quite heavy if used too liberally. For instance, using dynamic bodies when static bodies would do is sure to lead to higher than necessary resource usage.

Thanks again!

I am just testing something else:

I have a listener attached to all enemies like this

enemy.touch=theEnemyListener enemy:addEventListener("touch",enemy)

And later when the enemy is getting removed (but NOT in the Enemy table!!!) I do:

enemy:removeEventListener("touch",enemy)

BUT I still have stored the enemy.touch=theEnemyListener then, because the Enemy table ref is still there, right. So with 1000 and more enemies this also can get huge I guess.

So with doing:

enemy.touch=nil

there should be an increase in performance I hope.

it isn’t bringing a lot of speed :frowning:

One more thing:

is there a way to store the new created enemies in an array and “safely” remove them from this array fast! So this array can be used to do a collision check with a circle circle collision detection (not physics)?

Right now I just store every enemy in the array (means a reference) which get’s too much with a LOT of enemies. I should remove the destroyed enemies from this ref table also, but how can I do this in a fast way and still use the table to do the collision check?

UPDATE: I will remove this question to another thread because it is off topic here.