Originally posted by Grimsk8ter11
This is an example of how to use clicking for different things. Ill show you a basic minign with click code.
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim x1 As Long, y1 As Long x1 = (X / PIC_X) y1 = (Y / PIC_Y)
If Map.Tile(x1, y1).Type = TILE_TYPE_MINING Then Dir = GetPlayerDir(MyIndex) Select Case Dir Case DIR_UP If (GetPlayerY(MyIndex) + 1) <> y1 Then AddText "You must be next to the rock you are tryign to mine!", BrightRed Else Call RockHit(Map.Tile(x1, yl).Data3) AddText "You hit the rock!", BrightRed End If Case DIR_DOWN If (GetPlayerY(MyIndex) - 1) <> y1 Then AddText "You must be next to the rock you are tryign to mine!", BrightRed Else Call RockHit(Map.Tile(x1, yl).Data3) AddText "You hit the rock!", BrightRed End If Case DIR_RIGHT If (GetPlayerX(MyIndex) + 1) <> x1 Then AddText "You must be next to the rock you are tryign to mine!", BrightRed Else Call RockHit(Map.Tile(x1, yl).Data3) AddText "You hit the rock!", BrightRed End If Case DIR_LEFT If (GetPlayerX(MyIndex) - 1) <> x1 Then AddText "You must be next to the rock you are tryign to mine!", BrightRed Else Call RockHit(Map.Tile(x1, yl).Data3) AddText "You hit the rock!", BrightRed End If End Select End If End Sub
you could advance it and make ti so if they are next tot he rock in any diection it turns them to it and mines, btu iw as jsut showing an example.
you can see nwo how you could use clickign for walking ect as well hopefully.
|