Results 1 to 3 of 3

Thread: asking.......

  1. #1
    t420h
    Guest

    Talking 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

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    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)

  3. #3
    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
    You could have it like this:

    VB Code:
    1. Dim Speed As Long
    2.  
    3. Private Sub Timer1_Timer()
    4.     'Move the car according to the speed
    5.     picCar.Top = picCar.Top - Speed
    6.  
    7.     'Decrease the speed a bit over time...
    8.     Speed = Speed - 1
    9. End Sub
    10.  
    11. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    12.     Speed = Speed + 5
    13. End Sub

    That should work
    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