Wrap X & Y Problem
JCFord
Member Posts: 785
I have a large game area 960x640 and the camera is setup at the standard 480x320 size.
I have actors moving all over the game area, and to optimise the frame rate I have an Actor I have called ANTI-FREEZE the same size as the camera 480x320 that follows the camera and when any of my actors are onscreen they will move, but if they are off screen not in contact with the ANTI-FREEZE actor they freeze. and this worked great and has improved my frame rate.
My game area wraps X & Y so if an actor goes off the screen bottom they will float back in at the top etc But I have an issue that as my actors are floating off the edge of the screen they are freezing - so they appear half on half off either side but frozen.
Because my ANTI-FREEZE actor is the exact size of the camera I wondered if these actors were kind of half-in-half out of the actor ANTI-FREEZE and shtiks was causing the problem, so I have tried to increase the actor ANTI-FREEZE to make it oversize, but as soon as my actors get to the edge of the screen they still freeze and don't continue off to the other side of the screen like I want?
Confusing I know, but Anyone have any ideas?
I have actors moving all over the game area, and to optimise the frame rate I have an Actor I have called ANTI-FREEZE the same size as the camera 480x320 that follows the camera and when any of my actors are onscreen they will move, but if they are off screen not in contact with the ANTI-FREEZE actor they freeze. and this worked great and has improved my frame rate.
My game area wraps X & Y so if an actor goes off the screen bottom they will float back in at the top etc But I have an issue that as my actors are floating off the edge of the screen they are freezing - so they appear half on half off either side but frozen.
Because my ANTI-FREEZE actor is the exact size of the camera I wondered if these actors were kind of half-in-half out of the actor ANTI-FREEZE and shtiks was causing the problem, so I have tried to increase the actor ANTI-FREEZE to make it oversize, but as soon as my actors get to the edge of the screen they still freeze and don't continue off to the other side of the screen like I want?
Confusing I know, but Anyone have any ideas?
Comments
ORBZ to answer your question my actor ANTI-FREEZE is constrained by its own X & Y position to that of the scene camera origin X & Y.
It works beautifully freezing anything thats outside of ANTI-FREEZE or any actor that moves out of ANTI-FREEZE, but as soon as an actor reaches the edge on the canvas area and should wrap onto the opposite side of the screen it freezes half-on half-off even though ANTIFREEZE itself has wrapped - very odd!