rednblackgames / HyperLap2D

A powerful, platform-independent, visual editor for complex 2D worlds and scenes.
https://hyperlap2d.rednblack.games/
GNU General Public License v3.0
376 stars 67 forks source link

Sprite Animation freeze using SpriteAnimationComponent / SpriteAnimationStateComponent #31

Closed aallnneess closed 3 years ago

aallnneess commented 3 years ago

Problem: Sprite Animation freeze using SpriteAnimationComponent / SpriteAnimationStateComponent. The first image of the animation is loaded, but no animation.

Ive build an playerSpriteManager method, called in the render function:

` private void playerSpriteManager(){

    SpriteAnimationComponent spriteAnimationComponent = ComponentRetriever.get(player,SpriteAnimationComponent.class);
    SpriteAnimationStateComponent spriteAnimationStateComponent = ComponentRetriever.get(player,SpriteAnimationStateComponent.class);

    spriteAnimationComponent.fps = 24;
    spriteAnimationComponent.currentAnimation = "walk";
    spriteAnimationComponent.playMode = Animation.PlayMode.LOOP;

    spriteAnimationStateComponent.set(spriteAnimationComponent);

}`

Inside h2d:

Hyperlap 0.0.6-Snapshot Windows 10 64bit Intellij OpenSk 15

fgnm commented 3 years ago

Not a issue :smile:

aallnneess commented 3 years ago

shame on me 😜

My mistake: animation was restarted in every frame.