Results 1 to 6 of 6

Thread: Damned, how?????

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2001
    Location
    Ya don't wanna know...
    Posts
    25

    Angry Damned, how?????

    Hello,

    You're all talking about how bad timers are, but how can I count then? I don't understand gettickcount .




    PLEASE EXPLAIN!!!!!!!!!!!!!!!!!!!!!!!!!!
    The world would be better without

    !!!!!!!!!!!YOU!!!!!!!!!

  2. #2
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    The API GetTickCount returns how long the computer has been on. So, to use it, you would have to GetTickCount at one point, and get it again at another point, and subtract the first point from the second point. Like this..

    VB Code:
    1. Private Declare Function GetTickCount Lib "kernel32" () As Long
    2.  
    3. Private Sub Form_Load()
    4.     Dim aCount&, bCount&, tCount&, i&
    5.    
    6.     aCount& = GetTickCount
    7.     MsgBox "The next message box that appears will tell you how long this one has been open!"
    8.     bCount& = GetTickCount
    9.     tCount& = bCount& - aCount&
    10.     MsgBox tCount& & " milliseconds, or " & tCount& / 1000 & " seconds."
    11. End Sub

    Hope that helps.
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2001
    Location
    Ya don't wanna know...
    Posts
    25
    Thanks,


    The basics are starting to come,

    but like, moving a picturebox like your car in gta, so you can see it move,

    How do you do that???????????
    The world would be better without

    !!!!!!!!!!!YOU!!!!!!!!!

  4. #4
    Hyperactive Member
    Join Date
    Feb 2001
    Posts
    421
    You can do that because it's a 3D game. All you have to do is change the camera position. Visual Basic controls are 2D meaning that it can't be done with just "Picture Boxes". Study up on something called Direct3D that's in DirectX8.
    [vbcode]
    ' comment
    Rem remark
    [/vbcode]

  5. #5
    Zaei
    Guest
    If you want to program games with VB, forget everything you know about controls. All you should ever use is maybe a single picturebox, to act as a back buffer, and perhaps a few more to hold images.

    Each frame is draw, the frame is then displayed on the screen, and the back buffer is cleared for another frame. Because of this, its not as if you were moving a control, instead, you are drawing in a different place.

    Z.

  6. #6
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Click the Articles button at the top of this page, you should find a Lander Game tutorial. It teaches you how to do all that, and it's very easy
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

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