Results 1 to 5 of 5

Thread: How do you move something from point to point without 10000 timers

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Heaven........ Whats that fire doing here?
    Posts
    39

    Question 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............

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Do you want him to move on the 'leg' of a triangle or the hypotenuse?

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    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]

  4. #4

    Thread Starter
    Member
    Join Date
    Nov 2001
    Location
    Heaven........ Whats that fire doing here?
    Posts
    39

    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

  5. #5
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    How about a simple clause in your timer:
    VB Code:
    1. Private Sub MoveTime_Timer()
    2. Static Part As Integer
    3.    Select Case Part
    4.       Case 0
    5.          [move the x coordinate]
    6.          [move the y coordinate]
    7.          If [at "Point B"] Then Part = 1
    8.       Case 1
    9.          [move the x coordinate]
    10.          [move the y coordinate]
    11.          If [at "Point C"] Then Part = -1 'cease execution.
    12.    End Select
    13. 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
  •  



Click Here to Expand Forum to Full Width