0
\$\begingroup\$

I only use Scene2d for the UI layer of my libGDX game. But I need some animations like fading or rotating on my players.

Which is better for performance:

Scene2d fade action or having multiple frames with different opacity and using them in the Animation class?

Also scene2d rotate action or having multiple frames with different angle?

Thanks!

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I write in LibGDX for a while and in my opinion it's better to write players movement/rotation/jumping in the code directly and leave Actions for the UI.

It depends if it's a single-player game like a platformer, or a fast-paced multiplayer game, but usually you should not use Actions for the player because Actions are pooled/queued and they'll be slower than the manual setup.

Rotation and fading can be made on Actions or Universal Tween Engine but if you need more elements in the future like jumping/shooting and custom, precise interpolation for movement you should have your own system.

  • Actions for the UI
  • Manual for the player's movement/jumping/input etc.
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .