Posted: Mon Jul 17,
2006 10:47 pm
Post subject: Click To Actions
For this I suggest
using Pingu's Click to Move code also. This code
will allow you to pick up items by clicking with
left mouse button and attacking with right mouse
button.
Find
Code:
Private Sub
picScreen_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As
Single)
If you do NOT have Click to Move
then Replace Whole Sub With:
Code:
Private Sub
picScreen_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
If Button = 2 Then
ControlDown =
True
Call CheckAttack
End If
Call
EditorMouseDown(Button, Shift, X, Y)
If frmMapEditor.Visible =
False Then If Button = 1 Then
Call
PlayerSearch(Button, Shift, X, Y)
Call
CheckMapGetItem
End If End If End Sub
If you DO have Pingu's Click to
Move then replace the whole sub with
Code:
Private Sub
picScreen_MouseDown(Button As Integer, Shift As
Integer, X As Single, Y As Single)
If Button = 2 Then
ControlDown =
True
Call CheckAttack
End If
Call
EditorMouseDown(Button, Shift, X, Y)
If frmMapEditor.Visible =
False Then If Button = 1 Then
Call
PlayerSearch(Button, Shift, X, Y)
XToGo = (X +
(NewPlayerX * PIC_X)) / PIC_X
YToGo = (Y +
(NewPlayerY * PIC_Y)) / PIC_Y
Call CheckMapGetItem
End If
End If End Sub
This maybe stupid but
where does it determine if you are next to the monster
to attack it. I added something to this and I can right
click anywhere to do it not just on the monster.
And yeah continuous attack would be good. Sure
wouldnt be too hard.
Doesnt work for me,
But i have a completly different mousedown code, So
might want to make the tut an actual tut for where to
put each part of the code not a copy and paste
ergh this is simple
as it gets it doesn't even matter if you have a
differen't code. If you don't understand this one then I
suggest you start studying because the code I made isnt
beyond beginners.
Joined: 14 May 2006 Posts: 63 Location:
The Netherlands, Amsterdam
Posted: Sat Sep 16,
2006 11:38 pm
Post subject:
Thanks for this tut.
I've put "Button = 2" after "If Button = 1
Then", Cause I won't shoot ranged weapons during
MapEditor.
Code:
Private Sub
picScreen_MouseDown(Button As Integer, Shift As
Integer, x As Single, y As Single)
Call EditorMouseDown(Button, Shift, x, y)
If
frmMapEditor.Visible = False Then
If Button = 1 Then
Call PlayerSearch(Button,
Shift, x, y)
XToGo = (x + (NewPlayerX * PIC_X)) /
PIC_X
YToGo = (y + (NewPlayerY * PIC_Y)) / PIC_Y
Call
CheckMapGetItem
End If If Button = 2 Then
ControlDown = True
Call CheckAttack
End If End If
End Sub
Joined: 23 Feb 2006 Posts:
3402 Location: Antartica
Posted: Sun Sep 17,
2006 8:19 am
Post subject:
I fixed the indention
problems and substituted a better variable for the
editor check.
I'm just wondering if you really
need the "CheckAttack" thing, because I believe it does
that in gameloop anyway.
Code:
Private Sub
picScreen_MouseDown(Button As Integer, Shift As
Integer, x As Single, y As Single)
Call EditorMouseDown(Button, Shift, x, y)
If Not
InEditor Then If
Button = 1 Then
Call PlayerSearch(Button, Shift, x,
y)
XToGo = (x + (NewPlayerX * PIC_X)) / PIC_X
YToGo = (y + (NewPlayerY * PIC_Y)) / PIC_Y
Call
CheckMapGetItem
End If If Button =
2 Then
ControlDown = True
Call CheckAttack
End If End
If End Sub
I hate to bring old
topics back to life all of a suden but would it be
possible to change it so you could also use the right
click menu and constianly atk with the moving and
pickign up option you us the atk click to atk with the
left same as the pick up. do you think somthing liek
this would be possible. pingu anyone. edited: umm
like a double click for atk for left key.
Genusis
You cannot post new topics in this
forum You cannot reply to topics in this
forum You cannot edit your posts in this
forum You cannot delete your posts in this
forum You cannot vote in polls in this
forum