|
-
Jan 6th, 2002, 12:46 PM
#1
Thread Starter
Junior Member
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!!!!!!!!!
-
Jan 6th, 2002, 01:03 PM
#2
Hyperactive Member
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.
[vbcode]
' comment
Rem remark
[/vbcode]
-
Jan 6th, 2002, 01:19 PM
#3
Thread Starter
Junior Member
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!!!!!!!!!
-
Jan 6th, 2002, 01:34 PM
#4
Hyperactive Member
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]
-
Jan 6th, 2002, 02:22 PM
#5
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.
-
Jan 6th, 2002, 02:38 PM
#6
Frenzied Member
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
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
|