you'd need to make a function that checks how long it takes to press, release and press a key. I think this will do, but haven't checked it. Use run_speed to move your character.

 Code:
var tap_counter;
var run_speed;

...

while (1) {
  
  if (key_cur || key_cul) {
    tap_counter = 0;
    
    while (key_cur || key_cul) { wait(1); } //wait for the key to be released
    while (!key_cur && !key_cul) { tap_counter += 1 * time_step; wait(1); } //wait for the key to be pressed again, activate counter
    
    run_speed = (key_cur - key_cul) * (1/tap_counter); //calculate direction and multiply by the 'slowness' of pressing key
  }
  
  wait(1);
}


Last edited by Joozey; 04/30/08 13:22.

Click and join the 3dgs irc community!
Room: #3dgs