Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Npc Walking Alterations (Based off Advocate's tut)
#3
alrighty pando sure Big Grin
its not really much
Code:
If Player(Index).Attacking = 0 Then
       Select Case GetPlayerDir(Index)
           Case DIR_UP
               Anim = 0
               If (Player(Index).YOffset < PIC_Y / 3) Then
               Anim = 1
               ElseIf (Player(Index).YOffset > PIC_Y / 3) And ((Player(Index).YOffset > PIC_Y / 3 * 2)) Then
               Anim = 2
               End If
           Case DIR_DOWN
               Anim = 1
               If (Player(Index).YOffset < PIC_X / 4 * -1) Then Anim = 0
               If (Player(Index).YOffset < PIC_X / 2 * -1) Then Anim = 2
           Case DIR_LEFT
               Anim = 0
               If (Player(Index).XOffset < PIC_Y / 3) Then
               Anim = 1
               ElseIf (Player(Index).XOffset > PIC_Y / 3) And ((Player(Index).XOffset > PIC_Y / 3 * 2)) Then
               Anim = 2
               End If
           Case DIR_RIGHT
               Anim = 0
               If (Player(Index).XOffset < PIC_Y / 4 * -1) Then Anim = 1
               If (Player(Index).XOffset < PIC_Y / 2 * -1) Then Anim = 2
       End Select
   Else
       If Player(Index).AttackTimer + 500 > GetTickCount Then
           Anim = 2
       End If
   End If
thats Advocates code. All i really did was change the (Player(Index)'s to MapNpc(MapNpcNum). so case dir right would be like
Code:
Case DIR_RIGHT
               Anim = 0
               If (MapNpc(MapNpcNum).XOffset < PIC_Y / 4 * -1) Then Anim = 1
               If (MapNpc(MapNpcNum).XOffset < PIC_Y / 2 * -1) Then Anim = 2
i would have explained more but there really isnt much to explain Big Grin
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)