Created
February 5, 2021 16:43
-
-
Save ArendPeter/b822bbd4723a2c9e2c86f15a160634ab to your computer and use it in GitHub Desktop.
CameraFollowPlayer.gml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// camera follow player | |
var cam_x = oPlayer.x - camW()/2 | |
var cam_y = oPlayer.y - 150 | |
cam_x = clamp(cam_x, 0, room_width-camW()) | |
cam_y = clamp(cam_y, 0, room_height-camH()) | |
camPos(cam_x, cam_y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment