|
-
Nov 14th, 2001, 01:29 AM
#1
Thread Starter
Member
How do you move something from point to point without 10000 timers
Ok, to get an image to move to the left, then up then to the top left in a program made me use 6 counters, and thats just a smalllllllllll part..... is there anyway to use 1 timer and make the img (ImgGuy) to move from foint a to point b to point c....... with 1 timer not 6. Is there any way of doing this????? and please explain it in detail.... I have looked at other threads and forums and I just do not get it
Thanks much............
-
Nov 14th, 2001, 01:32 AM
#2
So Unbanned
Do you want him to move on the 'leg' of a triangle or the hypotenuse?
-
Nov 14th, 2001, 05:20 AM
#3
Retired VBF Adm1nistrator
Just keep a list of co-ordinates, or work out the route it'll have to take, then each time the timer event fires, just move to the next co-ord.
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Nov 18th, 2001, 01:03 AM
#4
Thread Starter
Member
huh???????????????
Do you want him to move on the 'leg' of a triangle or the hypotenuse?
-Huh?? what do you mean?
---------------------------------------------------------------------------------
Just keep a list of co-ordinates, or work out the route it'll have to take, then each time the timer event fires, just move to the next co-ord.
- What do you mean, please give an example
-
Nov 18th, 2001, 09:56 AM
#5
Good Ol' Platypus
How about a simple clause in your timer:
VB Code:
Private Sub MoveTime_Timer()
Static Part As Integer
Select Case Part
Case 0
[move the x coordinate]
[move the y coordinate]
If [at "Point B"] Then Part = 1
Case 1
[move the x coordinate]
[move the y coordinate]
If [at "Point C"] Then Part = -1 'cease execution.
End Select
End Sub
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|