|
-
Nov 1st, 2001, 03:07 PM
#1
asking.......
i might be making a gome for a project (a simple one) where two playrs are racing. i want, every time a playe presses a specified button, the car will speed up.
question: to make it go faster would i just make the timer interval increase by a number every time a button is prssed? and oppisite to slow down?
if you have any other ideas, please let me know!
thanx
-
Nov 1st, 2001, 04:33 PM
#2
Good Ol' Platypus
Definately not.. increase an increment variable that you add to an X or Y value every time!
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Nov 2nd, 2001, 06:16 PM
#3
Frenzied Member
You could have it like this:
VB Code:
Dim Speed As Long
Private Sub Timer1_Timer()
'Move the car according to the speed
picCar.Top = picCar.Top - Speed
'Decrease the speed a bit over time...
Speed = Speed - 1
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Speed = Speed + 5
End Sub
That should work
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
|