0 votes

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        |
|       / \       |
|       / \       |
|-----------------|
Godot version 3.2.3.stable.official
in Engine by (12 points)

1 Answer

0 votes

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.

by (10,914 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.