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.
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.