I recently started using corona for some pet projects. I've spent a great deal of time exploring tutorials and community code. I'm trying to build a simple shooter as an example and am finding that I keep fighting the physics engine. I would like to be able to move the enemies directly and still be able to detect collisions with other enemies as well as bullets. If I make the enemies static so they don't react to physics then I can move them around, but collisions with other enemies disappears. It's like I need collision detection, and bullet projectiles, but nothing else that the physics engine does... I mean nothing.
So I have a few question although a bit simple some may be somewhat opinion based and most are yes/no.
First of all is there a way to turn off all of the physics bodies reacting and still get collision detection?
If not, would I be better off writing my own collision and projectile code?
If I do, is there a way to write this code not in Lua, but something more native, maybe like plugin code? (looking for speed and efficiency)
Best Answer thomas6 , 06 June 2019 - 12:36 AM
I never use physics, and always write my own using simple math.
Using math.cos, math.sin, math.atan2 and pythagoras' formula (for calculating distance) is basically all you need. Collission code is often really easy to do, and speed and efficiency are good in Lua, no need for native code unless you're going very high end.