0 votes

I am working on a simple 2d platformer, but with fast racing like movement. Think speed like Sonic the Hedgehog but faster. This means I go past the terrain/tilemaps pretty quickly.

I seem to hit some 2D editor limit of 20k pixels or something, and its a pain to continue panning to the right to extend the level and place more tiles to build the level.

Should I be programmatically creating the levels in some way or just loading scenes in a way that the player doesn't notice to traverse long distances at high speed ?

in Engine by (15 points)

2 Answers

+1 vote
Best answer

There are two ways to go about this but both ways require splitting the level into parts as separate scenes that can seamlessly transition as the player runs across them.
The first way is to have parts of the level spawn and move across whilst the player and camera remain still on the X axis.
The other way is to have the player move across the level parts and at the end of each part teleport everything back the distance the part covered so the player is back to 0 on the X axis.
In both case the previous level part can call queue_free() when it's out of view.

by (3,247 points)
selected by
0 votes

The 2D-editor view scrolling is only limited by the bounds of the scene objects. Probably to prevent the view from getting too far from the scene content.

You could just create one Sprite or Control that's scaled to span 100,000 x 100,000 pixels (or whatever is necessary), then you can easily scroll inside that area.

by (38 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 Frequently asked questions and 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 [email protected] with your username.