1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-07-05 20:55:23 +00:00

Adjust animation speed calculation. (#100)

Not entirely sure how correct this is, but it's an improvement.
This commit is contained in:
Ziemas 2019-11-07 23:27:21 +01:00 committed by Tim Sarbin
parent ed237307bd
commit 5260fb7df7

View File

@ -76,7 +76,7 @@ func (v *AnimatedEntity) Render(target *ebiten.Image, offsetX, offsetY int) {
func (v *AnimatedEntity) cacheFrames() {
animationData := AnimationData[strings.ToLower(v.token+v.animationMode+v.weaponClass)][v.direction]
v.animationSpeed = int((float64(animationData.AnimationSpeed) / 255.0) * 0.04 * 1000.0)
v.animationSpeed = int(1000.0 / ((float64(animationData.AnimationSpeed) * 25.0) / 256.0))
v.framesToAnimate = animationData.FramesPerDirection
v.lastFrameTime = time.Now()
minX := int32(2147483647)