Skip to content

G-Switch 2: read levels and Endless pools directly from G-Switch2.js - #554

Open
thatbignguy wants to merge 1 commit into
Mason363:mainfrom
thatbignguy:pr-gswitch2-levels-js
Open

thatbignguy wants to merge 1 commit into
Mason363:mainfrom
thatbignguy:pr-gswitch2-levels-js

Conversation

@thatbignguy

Copy link
Copy Markdown
Contributor

What it does

Updates games/gswitch2/tools/convert_levels.py so it reads all 72 levels (Level1..3, M1..M6, E1..E63) and Endless.createNewSection directly from the web build's G-Switch2.js (no separate extraction step or extra dependencies needed):

python3 -I tools/convert_levels.py <path/to/G-Switch2.js or web_build_dir> [out_dir]

It also stays compatible with a pre-extracted directory containing levels/*.json and classes/Endless.js.

How I tested it

  • Ran python3 -I games/gswitch2/tools/convert_levels.py against G-Switch2.js, the web build folder, and the extracted folder into temporary directories — all three run in ~0.2s and reproduce src/assets/gs_levels_data.h and src/assets/gs_levels_data.c byte-for-byte.

Before you send it

  • No player-facing texts changed
  • Saves from the version before still load (game binary unchanged)
  • Borrowed pictures, fonts and code are credited (converter script only; no game assets added)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant