Wrap-around sprites (like the game Asteroids)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By daviewales

Is it possible to setup Godot so that sprites will automatically wrap around, like in the game Asteroids?

In Asteroids, as a sprite exits the top of the screen it appears at the bottom and similarly for the left and right. Specifically, the part of the sprite which has exited the top appears immediately at the bottom. e.g. It’s the view which is wrapped, rather than the sprite itself.

Is this possible in Godot?

Example:

Frame 1:

|-----------------|
|        O        |
|       / \       |
|       / \       |
|                 |
|                 |
|-----------------|

Frame 2:

|-----------------|
|       / \       |
|       / \       |
|                 |
|                 |
|        O        |
|-----------------|

Frame 3:

|-----------------|
|       / \       |
|                 |
|                 |
|        O        |
|       / \       |
|-----------------|

Frame 4:

|-----------------|
|                 |
|                 |
|        O        |
|       / \       |
|       / \       |
|-----------------|
:bust_in_silhouette: Reply From: jgodfrey

I don’t think there’s any in-built, automatic way of doing this (showing parts of the same sprite on opposite sides of the screen). Though, you could do it manually by the careful positioning of 2 sprites (one on each edge) during the transition period.