Hello, I'm making a game very similar to Light Cycles in Tron. I have a sprite of a cycle that adds another sprite of a wall. My problem is collision detection between the cycle and enemy wall. It will only collide on the current wall being spawned instead of each of them. Any suggestions?
Multiple Sprite Collision Detection
(5 posts) (3 voices)-
Posted 9 months ago #
-
Use a physics engine, it will work out better in the long run.
Posted 9 months ago # -
Your description of the cycle and wall or walls is too vague.. I remember Tron, but not the details of the light cycle portion.
Use a physics engine, it will work out better in the long run.
That depends on the collision details and requirements of the game.. People are so quick to suggest using physics engines even when far simpler collision methods would be fully acceptable for the job, using far less overhead.
Posted 9 months ago # -
It's a lot like snake. A trail follows the player making 90 degree turns. Each frame as the player moves a sprite spawns behind it. I was using redplayer.position.x = bluelight.position.x...etc to collision but it doesn't work the way i want.
Posted 9 months ago # -
Oh, try using CGRectIntersectsRect, and the bounding box of the sprite. Or, you could use pixel perfect collision detection, search the forum for that.
Posted 9 months ago #
Reply
You must log in to post.