Personally, I'd make these scripts: viewBoundsLeft = GetViewBoundsLeft(x), viewBoundsTop = GetViewBoundsTop(y). Then use them as playerBoundsLeft = GetviewBoundsLeft(player.x) and similarly for playerBoundsTop. Then I'd put the polling code within the camera object.
Are the border sizes always the same? I assume they are since they're always right outside of the player view. If they are always the same, you can simplify some of your camera code.
When the player view bounds changes from the actual view bounds, you can just lerp from the old view bounds to the new one. The lerping can be done in the camera object, independent of the player code. So basically, when you detect the new view bounds, you begin these separate (as in the code isn't mixed together) but related processes: camera movement, player movement and animation, doors, game freezing.
Personally, I'd make these scripts: viewBoundsLeft = GetViewBoundsLeft(x), viewBoundsTop = GetViewBoundsTop(y). Then use them as playerBoundsLeft = GetviewBoundsLeft(player.x) and similarly for playerBoundsTop. Then I'd put the polling code within the camera object.
Are the border sizes always the same? I assume they are since they're always right outside of the player view. If they are always the same, you can simplify some of your camera code.
When the player view bounds changes from the actual view bounds, you can just lerp from the old view bounds to the new one. The lerping can be done in the camera object, independent of the player code. So basically, when you detect the new view bounds, you begin these separate (as in the code isn't mixed together) but related processes: camera movement, player movement and animation, doors, game freezing.
_________________
|