player wont move on the X axis can anyone help me
VB Code:
Public Function Move(ByVal oMap As CMap, ByVal cDirection As DirectionConstants) As Boolean If Direction <> cDirection Then Let Direction = cDirection Exit Function End If If X <= 0 And Direction = DirectionLeft Then Let X = 0 Exit Function ElseIf X >= oMap.Width And Direction = DirectionRight Then Let X = oMap.Width Exit Function End If If Y <= 0 And Direction = DirectionUp Then Let Y = 0 Exit Function ElseIf Y >= oMap.Height And Direction = DirectionDown Then Let Y = oMap.Height Exit Function End If Select Case cDirection Case DirectionDown If Not oMap.Blocked(X, Y + 1) And Y + 1 >= 0 Then Let Move = True Let Y = Y + 1 End If Exit Function Case DirectionLeft If Not oMap.Blocked(X - 1, Y) And X - 1 >= oMap.Width Then Let Move = True Let X = X - 1 End If Exit Function Case DirectionRight If Not oMap.Blocked(X + 1, Y) And X + 1 >= oMap.Width Then Let Move = True Let X = X + 1 End If Exit Function Case DirectionUp If Not oMap.Blocked(X, Y - 1) And Y - 1 >= 0 Then Let Move = True Let Y = Y - 1 End If Exit Function End Select End Function




Reply With Quote