Performance

Hello, as everyone know, having sprite with dynamic body is really expensive for our device.

I have 2D Android 'mario style like' game but its more advanced, it has many obstacles and more more things.

Im using AND ENGINE.

Currently I managed to achieve about 58FPS while having on my game scene about:

~ 70 sprites responsible for act like walls, ground and so on (tiles, parts of the map)
~ 15 sprites with functions such as (trampoline, obstacle, collapsing box, moving platform)
~ 20 "coins" which might be pick up - it has also resize modifiers (which has effect like cool animation)

Now I have to thing about enemies! But I'm really afraid, I know I will use SpriteBatch for static tiles, so I will be able to improve performance a bit, but still with additional monsters on the scene, it may not be smooth 🙁

I have been testing my current game, by adding 6 test dynamic bodies, and gameplay started to be laggy, and FPS was much lower.

So my question is, how can I create "monsters" with different way, without using Dynamic Bodies?

Every tile is static body

[syntax="java"]PhysicsFactory.createBoxBody(this.mPhysicsWorld, s, BodyType.StaticBody, wallFixtureDef).setUserData(dataType);[/syntax]

My "enemy, monster" should be able to move right/left. Can I do it with simple sprite with static body?

Or maybe I can disable some unnecessary parts of the body?

Please help me, thanks.
well the easiest way is to use a basic shape for monster, like a circle. probably nobody will notice the difference, unless you want things like head-shot and so on..
Thanks for answer.

The problem is that I'm using easiest shape (I guess) which is square.

Now I'm thinking about using pool to use small amount of those bodies on the scene, and just changing their position depends on player position (reusing those objects)
are you asking what the performance would be with jbox2d? I'm pretty sure AND Engine has a completely different physics implementation
I have been just asking about some tips about what can I do to improve performance while using Dynamic Bodies for my monsters, I have been wondering about using Kinematic Bodies for monsters, but in fact physic is quite needed for those monsters, so its rather not good opinion.

Sorry by the way, I'm quite new and beginner with game development.
So are you using ANDengine with the Box2D extension?

Original thread: https://box2d.org/forum/viewtopic.php?t=7778