Probably not the most descriptive header ever. Anyway.
The game I'm picturing is a top down shooter, camera always centered on the Player Character, facing the mouse, with the terrain a random scattering of rocks and outcrops and such. I am having a problem with the wraparound functionality/maths however - basically the game is on the inside of a sphere, so walking in any direction will always bring you back to the same point. I've got no idea how to program this, though.
Here's what I have so far;
Start of frame - set Player X/Y Values to 500
This is basically initialising Player position, telling everything from here on out that the character's starting pos is 500,500 in the virtual world, even though the technical frame coords are like 240/320 whatever.
Start of Frame - Run loops to create Rock actives, includes set Rock XY values to (relevant maths to give them coords based on XY of Player)
So again, rock coords are not based on their frame position, but the relative position compared to the player.
The basic idea is when the Player "moves" (via a right click), as opposed to the Player moving in the frame, all the actives will shift around the Player based on the difference in desired position Coords vs current Coords. So if a right click points to a location that is, say, -20, -10 from the Player, all the items will shift -20, -10.
Here's my issue. Trying to run this as a loop (if Mouse coord X different, +/- X coord of Rock objects etc) has an issue with Coord maths. In the above example, the movement will appear directly diagonal until the Y coord is matched (since it's changing both X and Y by 1 each loop), but since the X coord is still out by 10, it will then move in a straight line until it resolves back to 0/0.
How can I get around this, and have the Player appear to move in a straight(ish - doesn't have to be perfectly 360) line to the desired click location? Any ideas will help.