Original Notes: ===================== This game is not finished! That's why it's on my tutor account :) [WASD] or [Arrow keys] - Walk, Jump and crouch / hide. [Space] - Attack (Quickly for combos) Tips: ★ Hold jump longer for higher jumps, ★ Hit 'skulls' to swing ★ Jump up between walls to wall climb
What I added: ===================== The change I made is pretty subtle. Essentially, I made it so that the player can turn around without the camera position changing drastically. You'll notice that (unlike the original) you can turn around and walk a few pixels without the camera shifting much. However, once you start to move furthur in the new direction, the camera will change to follow you. This results in a smoother camera with less jumping around. How I did it: ==================== I made two additional variables - "cam_dir" and "cam_movement". "cam_dir" tracks the direction that the camera assumes the player is in. (If cam dir is towards the right, 90, it will have more empty space to the right of you than to the left. The opposite is also true.) However, cam_dir will only change to match the actual direction of the player if cam_movement is high enough. Cam movement is set to 0 when you are facing in the same direction as cam_dir. Cam movement goes up by one when you move in the direction opposite the camera. Lastly, cam movement goes down by one when you are facing in the direction opposite that of the camera, but not moving. (Note that cam_movement has a minimum value of 0; it will never go lower than that.) Eventually, the player will start running in the direction opposite the camera, cam_movement will become large enough, and the camera will turn around.