Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- switch cam_state
- {
- case "rest": // ----- When the player turns around ----
- if distance_to_object(follow) >= 72
- {
- x = lerp(x,floor(follow.x),0.001)
- if stay_y = 0
- {y = lerp(y,floor(follow.y) - 72 - maxheight,0.0003);}
- else
- {y = lerp(y,stay_y,0.1);}
- }
- else
- {
- if stay_y != 0
- {y = lerp(y,stay_y,0.1);}
- }
- playerfacing = obj_player.facing;
- followlerp = .0003;
- if abs(follow.x - x) >= 30 or abs(follow.y - y) >= 60
- // or follow.current_state = state.air or follow.current_state = state.swim
- { cam_state = "forward"; }
- break;
- case "forward": // ----- When the player is actively moving ----
- image_index = 0;
- if follow.vspd >= 3
- {fallscroll = lerp(fallscroll, 64, 0.07);}
- if follow.vspd >= 6
- {fallscroll = lerp(fallscroll, 192, 0.07);}
- else
- {fallscroll = lerp(fallscroll, 0, 0.15);}
- followlerp = lerp(followlerp, 0.1, .09)
- x = lerp(x,floor(follow.x) + cam_hspd,followlerp)
- if stay_y = 0
- {
- y = lerp(y,floor(follow.y) - 64 - maxheight + fallscroll + follow.vspd,followlerp);
- }
- else
- { y = lerp(y,stay_y,0.1); }
- break;
- case "look": // ----- When the player is actively moving ----
- followlerp = lerp(followlerp, 0.1, .09)
- x = lerp(x,floor(follow.x) + round(cam_hspd) + look_x,followlerp)
- if stay_y = 0
- { y = lerp(y,floor(follow.y) - 64 - maxheight - look_y,followlerp); }
- else
- { y = lerp(y,stay_y,0.1); }
- if obj_GLOBAL.h_rs != 1
- { cam_state = camera.forward; }
- // if follow.current_state != state.climb and follow.current_state != state.look and follow.current_state != state.swim
- // { cam_state = camera.forward; }
- break;
- case "bottomLock": // ----- When the player is actively moving ----
- image_index = 0;
- if follow.vspd >= 3
- {fallscroll = lerp(fallscroll, 64, 0.07);}
- if follow.vspd >= 6
- {fallscroll = lerp(fallscroll, 192, 0.07);}
- else
- {fallscroll = lerp(fallscroll, 0, 0.15);}
- followlerp = lerp(followlerp, 0.1, .09)
- x = lerp(x,floor(follow.x) + cam_hspd,followlerp)
- y = lerp(y,yLock,0.1);
- if follow.y < y-40
- { cam_state = "forward"; }
- if follow.y > y+110
- { cam_state = "forward"; }
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement