Hello,
You're all talking about how bad timers are, but how can I count then? I don't understand gettickcount .
PLEASE EXPLAIN!!!!!!!!!!!!!!!!!!!!!!!!!!
Printable View
Hello,
You're all talking about how bad timers are, but how can I count then? I don't understand gettickcount .
PLEASE EXPLAIN!!!!!!!!!!!!!!!!!!!!!!!!!!
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:
Private Declare Function GetTickCount Lib "kernel32" () As Long Private Sub Form_Load() Dim aCount&, bCount&, tCount&, i& aCount& = GetTickCount MsgBox "The next message box that appears will tell you how long this one has been open!" bCount& = GetTickCount tCount& = bCount& - aCount& MsgBox tCount& & " milliseconds, or " & tCount& / 1000 & " seconds." End Sub
Hope that helps.
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???????????
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.
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.
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 ;)