i would like my character in my game to start in one position but when i click over to another space it moves there and is still visible untill i click elsewhere. What is the code that i can make that happen? Thanks
Printable View
i would like my character in my game to start in one position but when i click over to another space it moves there and is still visible untill i click elsewhere. What is the code that i can make that happen? Thanks
It depends; one thing you must learn in programming is that there is no code that is universal. So, if you show us your code, we can show you our code.
Hope this helps....
Private Sub DrawFrame(framenumber As Integer, x As Integer, y As Integer)
If framenumber = 1 Then
Picture1.PSet (x, y), RGB(255, 0, 0)
Picture1.PSet (x - 1, y), RGB(128, 128, 0)
Picture1.PSet (x + 1, y), RGB(128, 128, 0)
Picture1.PSet (x, y + 1), RGB(128, 128, 0)
Picture1.PSet (x, y - 1), RGB(128, 128, 0)
'
ElseIf framenumber = 2 Then
Picture1.Line (x - 1, y - 1)-(x + 1, y + 1), RGB(255, 0, 0), B
Picture1.PSet (x, y), RGB(0, 0, 255)
Picture1.Line (x - 2, y - 1)-(x - 2, y + 1), RGB(128, 128, 0)
Picture1.Line (x + 2, y - 1)-(x + 2, y + 1), RGB(128, 128, 0)
Picture1.Line (x - 1, y - 2)-(x + 1, y - 2), RGB(128, 128, 0)
Picture1.Line (x - 1, y + 2)-(x + 1, y + 2), RGB(128, 128, 0)
ElseIf framenumber = 3 Then
Picture1.Line (x - 3, y - 3)-(x + 3, y + 3), RGB(255, 0, 0), BF
For tempx = 1 To 100
Randomize (Timer)
X1 = Int(Rnd * 6) - 2
Y1 = Int(Rnd * 6) - 2
X2 = Int(Rnd * 6) - 2
Y2 = Int(Rnd * 6) - 2
Picture1.PSet (x + X1, y + Y1), RGB(224, 224, 0)
Picture1.PSet (x + X2, y + Y2), RGB(0, 0, 0)
Next tempx
ElseIf framenumber = 4 Then
Picture1.Line (x - 6, y - 6)-(x + 6, y + 6), RGB(255, 0, 0), BF
For tempx = 1 To 200
Randomize (Timer)
X1 = Int(Rnd * 12) - 5
Y1 = Int(Rnd * 12) - 5
X2 = Int(Rnd * 12) - 5
Y2 = Int(Rnd * 12) - 5
Picture1.PSet (x + X1, y + Y1), RGB(224, 224, 0)
Picture1.PSet (x + X2, y + Y2), RGB(0, 0, 0)
Next tempx
ElseIf framenumber = 5 Then
Picture1.Line (x - 6, y - 6)-(x + 6, y + 6), RGB(0, 0, 0), BF
End If
End Sub
I'd suggest having two variables - stayX and stayY. Then, on the mousedown event, have these variables be set. Whenever you want to draw your character, have him drawn with the two new variables. Hope it works :)
how do i have them drawn? it just sits there(character) it wont move when i click somewhere
Look here....at the end of it...
http://www.vbforums.com/showthread.p...hreadid=211059
ok thanks that helps alot!
just one thing how do i get the ball to be something else (figure guy type thing) ?
Try doing something like this for a start...
Thanks alot! that really helped but i put in the guy and the picture is to big... do you know how i can minimize it on paint?
You have to go to the file menu...but of course I have the Norwegian version, so I have no idea what it is in the English version....But if I had translated it, it would be....Picture....Stretch/displace.....and you have to change the values in the pop up menu, to what you want....I think you have to change the value for the horizontal first, and then do the same to the vertical....I'm not sure if you can change both of the at the same time.
Thank you so much! There is another thing but i will post it in another forum.