简体   繁体   中英

LIBGDX - how to make dynamic polygons?

I am making 2D game, where I can move bones of hero. I don't want to use spritesheets. Hero's legs and arms are made by polygons, because I want to easily change it's colour.

But I have problem with "dynamic parts of body" i mean knee, ankle and others joints - I must remake polygons for this parts every frame, because for example I change knee angle - so I must create new polygon for knee joint.

This makes game laggy on mobile devices :/

Maybe I'm doing it wrong. How to make dynamic polygons in LIBGDX?

If you want to rotate a part of your character you can use the Polygon class http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/math/Polygon.html

And use the rotate function.

Spritesheets are not that bad anyways, I would rather use them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM