Okay, so min takes the lower of the two values you pass the function. Since you don't want the player to go above 1/3 of the screen, if the player's position is less than the 1/3 line (up is negative) set the view to the player's position -1/3 of the screen's height. But, if it isn't, you don't want to change the view's position. So, you use min(view.y, y-view.height/3). That will set the view's position properly in both cases.
For the other question, you can do this.
player -> Out of Vision -> Script Editor
- Code: Select all
x+=((xscreen<0)-(xscreen>view.width))*view.width;
When the actor is out of vision, it uses the conditions to determine which side of the view it is, and increases (or decreases) the x position by the width of the view. If you are to the right of the screen, the condition returns a -1, but if you are to the left, it returns a 1. And if you happen to be out of the view from up or down, it doesn't do anything, since the condition results in a 0.