Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically detect last level #5

Open
dsd opened this issue Jan 8, 2025 · 0 comments · May be fixed by #14
Open

Automatically detect last level #5

dsd opened this issue Jan 8, 2025 · 0 comments · May be fixed by #14
Assignees
Labels
Engineering Code or Godot-specific work

Comments

@dsd
Copy link
Member

dsd commented Jan 8, 2025

Currently the number of levels is hardcoded, and must coincide exactly with the number of TileMap/ scene files.

Can we auto-detect the number of levels by enumerating the directory and finding the number of levels inside?

@cassidyjames cassidyjames added the Engineering Code or Godot-specific work label Jan 8, 2025
@wjt wjt self-assigned this Jan 10, 2025
wjt added a commit that referenced this issue Jan 10, 2025
Previously, the number of levels was hardcoded in the Global script, and would
have to match the number of scene files in the TileMap directory.

Instead, when Global is initialized, enumerate the numbered scene files in that
directory; sort them numerically; and load them for good measure. The number of
levels is then determined from the number of scenes found.

Fixes #5
@wjt wjt linked a pull request Jan 10, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering Code or Godot-specific work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants