Skip to content

Commit ab5bcad

Browse files
Fix for Walking and Hurt Down Last Animations (#26)
* Fix Walking and Hurt Down Last Animations All animations that have a Col offset were double skipping past those frames (Walking was skipping the first frame, and Hurt Down Last skipped to 5 frames after the target) * Frame offsets fix for reverse animations The loop in the AddAnimation function uses range(x,y,z) where y is a "up to but not including" so we need to go below 0. As mentioned, the column is already included in the Rect2 function in "GetSpriteRect", so is unecessary. --------- Co-authored-by: Lou Bernardi <[email protected]>
1 parent e3636c2 commit ab5bcad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

addons/LPCAnimatedSprite/LPCAnimatedSprite2D.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ func AddAnimation(spriteSheet:LPCSpriteSheet, spriteFrames:SpriteFrames, animati
9999
spriteFrames.remove_animation(animationData.Name)
100100

101101
spriteFrames.add_animation(animationData.Name)
102-
var frameStart = animationData.FrameCount -1 if animationData.Reverse else animationData.Col
103-
var frameEnd = animationData.Col -1 if animationData.Reverse else animationData.FrameCount
102+
var frameStart = animationData.FrameCount -1 if animationData.Reverse else 0
103+
var frameEnd = -1 if animationData.Reverse else animationData.FrameCount
104104
var reversed = -1 if animationData.Reverse else 1
105105
for frame in range(frameStart, frameEnd , reversed):
106106
var atlasTexture = AtlasTexture.new()

0 commit comments

Comments
 (0)