Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. switch cam_state
  2. {
  3.     case "rest": // ----- When the player turns around ----
  4.         if distance_to_object(follow) >= 72
  5.         {
  6.             x = lerp(x,floor(follow.x),0.001)
  7.  
  8.             if stay_y = 0
  9.             {y = lerp(y,floor(follow.y) - 72 - maxheight,0.0003);} 
  10.             else  
  11.             {y = lerp(y,stay_y,0.1);}
  12.         }
  13.         else
  14.         {
  15.             if stay_y != 0
  16.             {y = lerp(y,stay_y,0.1);}  
  17.         }
  18.    
  19.         playerfacing =  obj_player.facing;
  20.         followlerp = .0003;
  21.    
  22.         if abs(follow.x - x) >= 30 or abs(follow.y - y) >= 60
  23.         //  or follow.current_state = state.air or follow.current_state = state.swim  
  24.         {  cam_state  = "forward";  }  
  25.     break;
  26.    
  27.     case "forward": // ----- When the player is actively moving ----     
  28.         image_index = 0;
  29.        
  30.         if follow.vspd >= 3
  31.         {fallscroll = lerp(fallscroll, 64, 0.07);}
  32.         if follow.vspd >= 6
  33.         {fallscroll = lerp(fallscroll, 192, 0.07);}        
  34.         else
  35.         {fallscroll = lerp(fallscroll, 0, 0.15);}
  36.    
  37.         followlerp = lerp(followlerp, 0.1, .09)
  38.    
  39.         x = lerp(x,floor(follow.x) + cam_hspd,followlerp)  
  40.    
  41.         if stay_y = 0
  42.         {
  43.             y = lerp(y,floor(follow.y) - 64 - maxheight + fallscroll + follow.vspd,followlerp);
  44.         }
  45.         else
  46.         {  y = lerp(y,stay_y,0.1);  }
  47.     break;
  48.    
  49.     case "look": // ----- When the player is actively moving ----    
  50.         followlerp = lerp(followlerp, 0.1, .09)    
  51.         x = lerp(x,floor(follow.x) + round(cam_hspd) + look_x,followlerp)
  52.    
  53.         if stay_y = 0
  54.         {  y = lerp(y,floor(follow.y) - 64 - maxheight - look_y,followlerp); }
  55.    
  56.         else
  57.         {  y = lerp(y,stay_y,0.1);  }
  58.  
  59.         if obj_GLOBAL.h_rs != 1  
  60.         {  cam_state  = camera.forward;  }
  61.     //    if follow.current_state != state.climb and follow.current_state != state.look and follow.current_state != state.swim
  62.        // {  cam_state  = camera.forward;  }
  63.     break;  
  64.    
  65.     case "bottomLock": // ----- When the player is actively moving ----  
  66.         image_index = 0;
  67.        
  68.         if follow.vspd >= 3
  69.         {fallscroll = lerp(fallscroll, 64, 0.07);}
  70.         if follow.vspd >= 6
  71.         {fallscroll = lerp(fallscroll, 192, 0.07);}        
  72.         else
  73.         {fallscroll = lerp(fallscroll, 0, 0.15);}
  74.    
  75.         followlerp = lerp(followlerp, 0.1, .09)
  76.    
  77.         x = lerp(x,floor(follow.x) + cam_hspd,followlerp)  
  78.  
  79.         y = lerp(y,yLock,0.1);  
  80.         if follow.y < y-40
  81.         { cam_state = "forward"; }
  82.         if follow.y > y+110
  83.         { cam_state = "forward"; }     
  84.     break; 
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement