home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Corrida / drifting.swf / scripts / frame_20 / DoAction.as
Encoding:
Text File  |  2005-08-23  |  1.2 KB  |  64 lines

  1. if(clockOn)
  2. {
  3.    _root.gameTicks = _root.gameTicks + 1;
  4. }
  5. if(!_root.ghostPlayback and _root.captureKeys)
  6. {
  7.    keyCapCode = 0;
  8.    if(Key.isDown(37))
  9.    {
  10.       keyCapCode += 1;
  11.    }
  12.    if(Key.isDown(39))
  13.    {
  14.       keyCapCode += 2;
  15.    }
  16.    if(Key.isDown(38))
  17.    {
  18.       keyCapCode += 4;
  19.    }
  20.    if(Key.isDown(40))
  21.    {
  22.       keyCapCode += 8;
  23.    }
  24.    keyCapture_array.push(keyCapCode);
  25.    keyCapture_str = "";
  26.    j = 0;
  27.    while(j <= keyCapture_array.length)
  28.    {
  29.       if(keyCapture_array[j] == 10)
  30.       {
  31.          keyCapture_str += "A";
  32.       }
  33.       else if(keyCapture_array[j] == 11)
  34.       {
  35.          keyCapture_str += "B";
  36.       }
  37.       else if(keyCapture_array[j] == 12)
  38.       {
  39.          keyCapture_str += "C";
  40.       }
  41.       else if(keyCapture_array[j] == 13)
  42.       {
  43.          keyCapture_str += "D";
  44.       }
  45.       else if(keyCapture_array[j] == 14)
  46.       {
  47.          keyCapture_str += "E";
  48.       }
  49.       else if(keyCapture_array[j] == 15)
  50.       {
  51.          keyCapture_str += "F";
  52.       }
  53.       else
  54.       {
  55.          keyCapture_str += keyCapture_array[j];
  56.       }
  57.       j++;
  58.    }
  59. }
  60. if(_root.gameActive)
  61. {
  62.    game_mc.car.updatePosition();
  63. }
  64.