0
votes

My question revolves around which technique's the best when implementing a game with AndEngine. In this game a user is able to do simple touch movements: drag, pinch and tap on certain objects which are represented by just sprites at the moment. At this time, the game doesn't really use any physics. The only thing that's being done regarding the sprites is pixel perfect collision detection (between sprites) and adding and removing these Sprites at real time. Just using Sprites gets the job done, but I was wondering if using the Box2D extension would be a better fit?

Which are the positive and negative points regarding using Box2D extension vs just the Sprites? And does one outweigh the other?

1

1 Answers

0
votes

The box2D extension is obviously used for physics simulation in the game. Sprites are used for showing images on screen. So they are different concepts. But if you want to have more reliable collision detection you may need to use box2d for that, even if you do not use physics in your game. Sprite collision detection is not pixel perfect in andEngine.

So in regard to use of box2D:

'+ more reliable collsion detection

'+ you can use bodies as solid bodyies and bounce them automaticlay (calculated by box2D) or as sensors (they do not bounce but report colision (or overlapping) with another body/sensor

'- need to code more and implement bodies for allsprites involved in collisions

'- coding for collision detection of bodies (if you want to use them as sensors, not to bounce them) is a bit harder, but not too hard