excaliburjs/excalibur-aseprite

AsepriteNativeParser parsing Forward AnimationTypes to AnimationStrategy.End

dericatienza opened this issue · 2 comments

The current behaviour of AsepriteNativeParser is to set animations' strategy to AnimationStrategy.End when its type is AnimationTypes.Forward. This is inconsistent with. AsepriteJsonParser which sets the strategy to AnimationStrategy.Loop by default or when the tag direction is 'forward'.

I suggest updating AsepriteNativeParser to follow the same behaviour and set animations strategy to AnimationStrategy.Loop by default.

AsepriteNativeParser's strategy setting logic:

let strategy = AnimationStrategy.End;
if (type === AnimationTypes.Forward) {
strategy = AnimationStrategy.End;
} else if (type === AnimationTypes.PingPong || type === AnimationTypes.PingPongReverse) {
strategy = AnimationStrategy.PingPong;
}

AsepriteJsonParser's strategy setting logic:

let strategy = AnimationStrategy.Loop;
switch(frameTag.direction) {
case "pingpong": {
strategy = AnimationStrategy.PingPong
break;
}
case "reverse": {
frames.reverse();
break;
}
}

@dericatienza Good find! Definitely agree and want these to be consistent!

Great! I submitted a PR #201.