Print Page | Close Window

Usefull clicking for cool stuff

Printed From: Mirage Source
Category: Tutorials
Forum Name: Submitted Tutorials
Forum Discription: Tutorial submissions for MSE are posted here, waiting for approval
URL: http://ms.shannaracorp.com/backup-forums/forum_posts.asp?TID=114
Printed Date: 20 December 2006 at 6:03pm
Software Version: Web Wiz Forums 8.01 - http://www.webwizforums.com


Topic: Usefull clicking for cool stuff
Posted By: Sync
Subject: Usefull clicking for cool stuff
Date Posted: 11 February 2006 at 2:10pm
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.



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums version 8.01 - http://www.webwizforums.com
Copyright ©2001-2006 Web Wiz Guide - http://www.webwizguide.info