![]() |
Mouse Movement (my way) - Printable Version +- Mirage Engine (https://mirage-engine.uk/forums) +-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61) +--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18) +---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49) +---- Thread: Mouse Movement (my way) (/showthread.php?tid=262) |
Mouse Movement (my way) - William - 23-08-2006 (cause I love MS so much, I decided to release it.. hope somebody likes it.) This tutorial can not be moved to any other forums, neither linked or anything. You can only come here to use it. I will not explain anything were to put the things, it's pretty simple. So figure it out on your own. Code: If Button = vbRightButton Then Code: Public Sub CharMove(ByVal X As Single, ByVal Y As Single) - William - 21-12-2006 The 2:nd part can go anywere. The first part goes in picscreen_mousemove and mouseclick - William - 22-12-2006 This code makes it so you hold the mouse down and the character moves, you will need to edit a lot to make it work so you click on "one" place and it moves to that point. - Dragoons Master - 22-12-2006 Actualy it isn't that hard. I added 3 variables named MoveTo,MoveToX,MoveToY. MoveTo is setted to true when you click the screen and does not click on an npc or player. then, inside Sub CheckMovement() change the line "If IsTryingToMove Then" to "If IsTryingToMove Or MoveTo = True Then" and inside "Function CanMove()" you can add, right under "Dir = GetPlayerDir(MyIndex)" a check to see if MoveTo is true, liek this: "If MoveTo = True Then". If it is, it moves the player to the position wanted just using the AI you developed. To make it move just change the value of this 4 variables: Code: DirUp changing them from false to true, depending on the direction you want the player to go to. |