hi everybody,
I have a room in my game where a player is. the camera doesn't move.
how can i make, when the player goes to the right, at the and of the view, the view changes and the player seems to be left and there is another room.
if(xscreen>(view.width)) {
view.x+=(view.width);
}
if(xscreen<0) {
view.x-=(view.width);
}
if(yscreen>(view.height)) {
view.y+=(view.height);
}
if(yscreen<0) {
view.y-=(view.height);
}
view.x += ((xscreen>view.width) - (xscreen<0))*view.width;
view.y += ((yscreen>view.height) - (yscreen<0))*view.height;
Users browsing this forum: No registered users and 1 guest