Results 1 to 5 of 5

Thread: A KeyCode Question..?

  1. #1
    -=QuikSilva=-
    Guest

    Question

    I am going to attempt to make a racing game for my high school computer programming class, and I'm trying to simulate a RPM Tach. I need to figure out a way so that when no keys are being pressed, for the RPMs to drop gradually....

    Is it possible to have a:

    While KeyCode = "" RPM = RPM - 100

    or something along those lines?

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Add a timer control, and place RPM=RPM-100 in there, set interval to for instance 50 ms.

    now when you press a key, add 200
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    -=QuikSilva=-
    Guest
    Thanks! That's what I did though right after I posted....

    This program is coming well, but I'm sure gonna have a hard time checking for a colision. Any suggestions?

    I already have all my directions, as well as shifting, RPM and accelerating done! I'm proud of that much!

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Depends, the most general collision detection is
    collision=dx=0
    how many dimensions are involved, and what shape of objects are colliding?
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    -=QuikSilva=-
    Guest
    Well, I'm gonna have to keep track of weather or not they are on the road still, or if they hit a wall or something...

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