OK click on view
click on draw actor
click on add action
click on script editor
view.x=(players name).x-150;
Now the view should follow the actor , adjust the -150 to whereever is comfurtable for you.
saveVars("save_file", "group");
LoadGame("game_file");
loadVars("save_file", "group");
//global code
int chkPos[2], viewPos[2];
//player's draw actor
chkPos[0]=x;
chkPos[1]=y;
viewPos[0]=view.x;
viewPos[1]=view.y;
x=chkPos[0];
y=chkPos[1];
view.x=viewPos[0];
view.y=viewPos[1];
Hblade wrote:Another good way is to make an array like this:
- Code: Select all
//global code
int chkPos[2], viewPos[2];
This allows you to store the players/views X and Y. Like so:
- Code: Select all
//player's draw actor
chkPos[0]=x;
chkPos[1]=y;
viewPos[0]=view.x;
viewPos[1]=view.y;
now when loading the checkpoint:
- Code: Select all
x=chkPos[0];
y=chkPos[1];
view.x=viewPos[0];
view.y=viewPos[1];
This is how I would do it
Bee's method is more user friendly though :3
Users browsing this forum: No registered users and 1 guest