SHARE
TWEET

Untitled

tyrz939 Jan 6th, 2017 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.    
  2.     // Frame & Input read loop
  3.     var inp, f0, f1, f2;
  4.     var i = 0;
  5.     replay_length = -1;
  6.     while file_bin_position(file) < file_bin_size(file){
  7.         // Frame Count
  8.         f0 = file_bin_read_byte(file) * 65536;
  9.         f1 = file_bin_read_byte(file) * 256;
  10.         replay[FRAME, i] = file_bin_read_byte(file) + f1 + f0;
  11.        
  12.         // Input
  13.         inp = file_bin_read_byte(file);
  14.         if inp >= 64 {replay[UP, i] = true; inp -= 64;} else {replay[UP, i] = false;}
  15.         if inp >= 32 {replay[DOWN, i] = true; inp -= 32;} else {replay[DOWN, i] = false;}
  16.         if inp >= 16 {replay[LEFT, i] = true; inp -= 16;} else {replay[LEFT, i] = false;}
  17.         if inp >= 8 {replay[RIGHT, i] = true; inp -= 8;} else {replay[RIGHT, i] = false;}
  18.         if inp >= 4 {replay[FOCUS, i] = true; inp -= 4;} else {replay[FOCUS, i] = false;}
  19.         if inp >= 2 {replay[SHOOT, i] = true; inp -= 2;} else {replay[SHOOT, i] = false;}
  20.         if inp >= 1 {replay[BOMB, i] = true; inp -= 2;} else {replay[BOMB, i] = false;}
  21.        
  22.         i++;
  23.         replay_length++;
  24.     }
RAW Paste Data
Top