mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-01-12 04:17:25 -05:00
Adjust animation speed calculation. (#100)
Not entirely sure how correct this is, but it's an improvement.
This commit is contained in:
parent
ed237307bd
commit
5260fb7df7
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user