I create a map storing some tiles in an array. The effect i want to achive is that when the display edge achives any border of the map, the tiles from opposite side start rendering next to the border (some sort of infinity in a big map). The problem is that i don't know how to do this so that when the display passes the upper edge and the left edge in same time, the "corner" beween renders. Also, how should i iterate trough the array to have less CPU cost?

The zone marked with "" is the "corner".

Can anyone point me any idea?

Getting a project done is by far the most hard thing in game development.

You couuuuuld seperate the map in chunks, so that lets say the yellow rectangle is a chunk, the red one is a chunk, etc. and then just render the chunks that should be on the screen. Easy as pie... at least in my current thought process

Which might prevent rounding errors for floating point numbers or overflow issues with integral numbers. This is not the fastest method, but it's the basic idea behind the modulus operator (remainder division.) You will need to "reset" the value within an acceptable range to prevent those types of bugs with large integers/floating points. You will have to split up the object, shift, and draw up to four separate "quadrants" (red, orange, yellow, and gray) to display the scene correctly. If you can't split every object then you may have to draw it four times for each screen boundary (drawing most of the object off screen.)

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org