06-09-2009, 02:27 AM
Ahh man i tried but i get lots of errors can some one help?
Code:
Public Sub BltPlayer(ByVal Index As Long)
Dim Anim As Long
Dim I As Long
Dim SpellNum As Long
Dim X As Long
Dim Y As Long
Dim Sprite As Long
Dim rec As DXVBLib.RECT
Sprite = GetPlayerSprite(Index)
' Check for animation
Anim = 0
If Player(Index).Attacking = 0 Then
Select Case GetPlayerDir(Index)
Case DIR_UP
If (Player(Index).YOffset < SIZE_Y / 96) Then Anim = 1
Case DIR_DOWN
If (Player(Index).YOffset < SIZE_Y / 0 * -1) Then Anim = 1
Case DIR_LEFT
If (Player(Index).XOffset < SIZE_Y / 32) Then Anim = 1
Case DIR_RIGHT
If (Player(Index).XOffset < SIZE_Y / 64 * -1) Then Anim = 1
End Select
Else
If Player(Index).AttackTimer + 500 > GetTickCount Then
Anim = 2
End If
End If
' Check to see if we want to stop making him attack
With Player(Index)
If .AttackTimer + 1000 < GetTickCount Then
.Attacking = 0
.AttackTimer = 0
End If
End With
With rec
.Top = 0
.Bottom = SIZE_Y
.Left = (GetPlayerDir(Index) * 3 + Anim) * SIZE_X
.Right = .Left + SIZE_X
End With
X = GetPlayerX(Index) * SIZE_X + Player(Index).XOffset
Y = GetPlayerY(Index) * SIZE_Y + Player(Index).YOffset - 4 ' to raise the sprite by 4 pixels
' Check if its out of bounds because of the offset
If Y < 0 Then
Y = 0
With rec
.Top = .Top + (Y * -1)
End With
End If