Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sprite Animation Bug Fix
#1
I probably wouldn't have noticed this if I wasn't making my own sprites but there are some minor errors in modDirectDraw7 which cause the wrong sprite rec to be drawn for the Up and Left directions.

in modDirectDraw7 find the Sub BltPlayer, the check for animation currently looks like this :
Code:
' Check for animation
    Anim = 0
    If Player(Index).Attacking = 0 Then
        Select Case GetPlayerDir(Index)
            Case DIR_UP
                If (Player(Index).YOffset < SIZE_Y / 2) Then Anim = 1
            Case DIR_DOWN
                If (Player(Index).YOffset < SIZE_Y / 2 * -1) Then Anim = 1
            Case DIR_LEFT
                If (Player(Index).XOffset < SIZE_Y / 2) Then Anim = 1
            Case DIR_RIGHT
                If (Player(Index).XOffset < SIZE_Y / 2 * -1) Then Anim = 1
        End Select
    Else



The condition on both the up and left direction Ifs statement needs to be greater than, like so:
Code:
' Check for animation
    Anim = 0
    If Player(Index).Attacking = 0 Then
        Select Case GetPlayerDir(Index)
            Case DIR_UP
                If (Player(Index).YOffset > SIZE_Y / 2) Then Anim = 1
            Case DIR_DOWN
                If (Player(Index).YOffset < SIZE_Y / 2 * -1) Then Anim = 1
            Case DIR_LEFT
                If (Player(Index).XOffset > SIZE_Y / 2) Then Anim = 1
            Case DIR_RIGHT
                If (Player(Index).XOffset < SIZE_Y / 2 * -1) Then Anim = 1
        End Select
    Else


The same will also need to be done under the BltNPC Sub.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)