View Single Post
Old
dakota95
Senior Member
 
dakota95's Avatar
 
Status: Offline
Posts: 426
Join Date: Aug 2011
Location: like I would tell you. ;)
Default 12-24-2011, 03:58 PM

Quote:
Originally Posted by XenElement View Post
This may be a stupid question, but I'm having a heck of a time finding the answer to it. How do I compare position using an if statement? I'm creating a false 2D game, and I need to know when the hero has gone off the camera's view, of out of the bounds of the stage. I know what the values are for the edges of the camera, but I can't seem to figure out how to compare the hero's position to those single values using an if statement.

My real objective is to teleport the hero to the other side if he goes off the screen, just like asteroids, so if anyone has a better method of doing that, please let me know.
what you can do is place two objects, one at each end of the screen, and say if guy is within x meters of object 1, move to object two.


<Insert_Signature_Here>
   
Reply With Quote