gurkenlabs / litiengine

LITIENGINE 🕹 The pure 2D java game engine.
https://litiengine.com/
MIT License
718 stars 94 forks source link

Adjust Creature sprite naming conventions #777

Open nightm4re94 opened 1 year ago

nightm4re94 commented 1 year ago

Instead of creature-walk-right.png, use creature-move-right.png for automatic animationcontroller initialization. Moving is a more generic name that applies also to creatures without legs.

Furthermore, determining the sprite states and directions by splitting spritesheet names at '-' characters is super prone to errors and doesn't allow you to deviate from the order at all. You can't, for example, call a sprite 'spaceship1-yellow-idle' because the 'yellow' part is then interpreted as sprite state. Use RegEx to determine sprite states and directions.