Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ask help to fix errors (game with wolf3d)
#3
One way to fix the sprite animation is to apply these changes. After loading the map:

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
Reply


Messages In This Thread
RE: Ask help to fix errors (game with wolf3d) - by Marcus - 02-05-2025, 06:12 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)