02-05-2025, 06:12 PM
One way to fix the sprite animation is to apply these changes. After loading the map:
In the game loop when updating the frame:
Code:
' Load map.
flags = w3d.LoadN6Map("assets/map.txt")
' marcus: set colorkey of image used for sprites to black
set image colorkey w3d.n6.imgDefs[7].img, 0, 0, 0
In the game loop when updating the frame:
Code:
' zombie, it'a bug, the zombie animation was overlapped
if vCrossFrameCounter = 0
vCrossFrame = (vCrossFrame + 1)%12
dst = w3d.n6.imgDefs[7].img
set image dst
' marcus: clear with colorkey color
set color 0, 0, 0
cls
set color 255, 255, 255
draw image zombie, 0, 0, vCrossFrame
set image primary
endif
vCrossFrameCounter = (vCrossFrameCounter + 1)%5