Take the 2-minute tour ×

I'm just beginning to program in C# and using XNA and would greatly appreciate any help.

I'm trying to implement a 2D camera with zoom (which I have working fine) with a looping world (background, enemies, environmental sprites etc.). To clarify: I'm attempting to make it seem as if you're playing in first person where you can turn 360 degrees. Almost as if you were in a 3D world but restricted to one point in that world. I'm trying to achieve this by moving the 2D camera left and right along the world/level and looping the world seamlessly around again once the camera reaches the edges.

I seem to be having great difficulty in figuring this out and any help would be greatly appreciated.


share|improve this question
With what aspect of it exactly are you having trouble? –  user1306322 Feb 14 '13 at 5:24
The area I'm having difficulty with is when the camera reaches an edge of the world. I can't get the camera to move from one edge of the world and appear at the opposite. –  user2070401 Feb 14 '13 at 14:01
So your game engine moves the camera along with player within the world? If so, you can add or subtract the width/height of the world from player and camera's positions when they go over the edge. –  user1306322 Feb 14 '13 at 14:22
add comment

Your Answer



Browse other questions tagged or ask your own question.