AnimationPlayer.cs - Renamed 'BaseTickSpeed' and set its value to 50

This commit is contained in:
miku-666
2023-05-09 13:00:15 +02:00
parent 6f273008c9
commit 045d9fb7ff

View File

@@ -10,7 +10,7 @@ namespace PckStudio.Forms.Editor
// TODO: write as a UI control ??
sealed class AnimationPlayer
{
public const int BaseTickSpeed = 48;
private const int TickInMillisecond = 50; // 1 InGame tick
public bool IsPlaying { get; private set; } = false;
private int currentAnimationFrameIndex = 0;
@@ -33,7 +33,7 @@ namespace PckStudio.Forms.Editor
if (currentAnimationFrameIndex >= _animation.FrameCount)
currentAnimationFrameIndex = 0;
Animation.Frame frame = SetDisplayFrame(currentAnimationFrameIndex++);
await Task.Delay(BaseTickSpeed * frame.Ticks);
await Task.Delay(TickInMillisecond * frame.Ticks);
}
IsPlaying = false;
}