Hello, I'm creating a game where an object can be moved through one side of the phone and appear on the other side. I want it to look smooth, so I do not want to just say: if you hit the right side, then go on the left side. If for example 30% of the object is outside the right edge, then we should see 30% of the object on the left side. A good example is the Rubik Squared game (here's an image) https://lh3.ggpht.com/tkwDsNT0yaztx8hHmhbmQjTP0DdPzw3lV-TD-5w1_oohHJeu65H5L_Q5GJFbu0wK9ZM=h900 where you see on the middle line, we see a part of the blue square on the right and the other part on the left.
I'm sure there might be many ways to do this, but if someone can provide some, it would be nice. A piece of code would be appreciated.