Hello everyone,

I have successfully made a Commandos Style game in vb that has one level(working on it). The player has the abillity to pick up weapons and such. But, when the player clicks the gun, i want the gun icon to be displayed as long as the cursor is within 600 Twips of the Player. Here what i have but it doesnt work.

VB Code:
  1. Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  2. Dim CX, CY As Integer
  3. Dim CursorPosition As PointAPI
  4.  
  5. GetCursorPos CursorPosition
  6.  
  7.  
  8. CX = CursorPosition.x
  9. CY = CursorPosition.y
  10.  
  11. If HoldSilPistol = True And CX <= MainFigure.Left - 600 Then
  12. Image2.MouseIcon = LoadPicture(App.Path & "\data\images\Entities\nopistol.ico")
  13. ElseIf HoldSilPistol = True And CX >= MainFigure.Left + MainFigure.Width + 600 Then
  14. Image2.MouseIcon = LoadPicture(App.Path & "\data\images\Entities\nopistol.ico")
  15. Else
  16. Image2.MouseIcon = silpistol.Picture
  17. End If
  18. End Sub
nopistol.ico is a gun picture with a cross over it showing that the user cant shoot here. But if the cursor is within 600 twips of the player, it shows the pistol icon.


Any ideas would be appreciated


Phreak