Hi everyone !
I'm new to this forum ;)
If i'm here today, it's to ask you a question about the simple way (or the most effective way), to make an horizontal loop in 2D platformer games.
But what do i mean by : horizontal loop ? :P
Two examples could be : super mario 3 battle mode, or Towerfall Ascension.
To explain it with words : in a 2D game with fixed view, when an object reach the end of the room (max right, min left, top, bottom), it might "loop" to the opposite place.
Screenshot (always easier to understand) :
So this is a towerfall ascension screenshot. You see the arrow is passing through the left to the opposite (right).
The difficulty is : how can a object can be at two positions at once ?
I tried two methods :
- Duplicate sprite and body collision (not the effective way i think).
- Use multiple views (i didn't manage to make it properly).
So, do you guys (or girls), know the best way to do that ?
For informations, i'm programming in c++ with SFML libraries.
But, what i'm searching is not a code, but an algorithm :rolleyes:
Hope, you could help me.
PS : I'm not speaking english fluently, so sorry if there are mistakes.