How detect collision between object1[i] and object2[j] then do something with them in Box2D games?
10. Červen 2024 v 23:30
I am making a simple game with Box2D and SDL2. I have GameObjects vectors for example: 1.vector of Enemy 2.vector of Bullets… in ContactListener class i can detect collision between enemyFixture and bulletFixture. How i can detect contact between Enemy[i] with Bullet[j] and do something only with Enemy[i] or Bullet[j]?! Thank you for your helps.