Share levels as files: download and upload on the web, files and drops on the desktop, share codes #12

Open
opened 2026-11-04 00:43:37 +00:00 by Weissstreifen · 1 comment

Share levels with other people as files: download them, send them, and upload what you got.

Export:

  • From My levels: Download one level, or Download all as one pack (my_levels.ccl). On the web this is a browser download, on the desktop a file in ~/Downloads (or a chosen folder), and the game shows where it went.

Import:

  • Upload opens the browser's file picker (.ccl, .txt). On the desktop: drop files on the window, or pick from the files in the import folder.
  • Dropping a file on the browser page works too.
  • A pack with many levels imports all of them; levels with the same title get a number (Climb (2)).
  • Every imported level goes through the validation; broken ones are listed with the reason instead of being added.

Share codes (small extra): copy a level as a text code to the clipboard (the board compressed and in base64), and paste a code to import, for sharing in a chat.

All of the file and clipboard handling comes from parin_kit#174 (core/file_share), the pack writing from parin_kit#176. Until they land, keep the game's versions in one small module with TODO: move to parin_kit, see parin_kit#174.

Done when: a level made in the web build on one computer can be downloaded, uploaded in the web build on another and played, and the same with the desktop build.

Share levels with other people as files: download them, send them, and upload what you got. **Export:** - From My levels: **Download** one level, or **Download all** as one pack (`my_levels.ccl`). On the web this is a browser download, on the desktop a file in `~/Downloads` (or a chosen folder), and the game shows where it went. **Import:** - **Upload** opens the browser's file picker (`.ccl`, `.txt`). On the desktop: drop files on the window, or pick from the files in the import folder. - Dropping a file on the browser page works too. - A pack with many levels imports all of them; levels with the same title get a number (`Climb (2)`). - Every imported level goes through the validation; broken ones are listed with the reason instead of being added. **Share codes** (small extra): copy a level as a text code to the clipboard (the board compressed and in base64), and paste a code to import, for sharing in a chat. All of the file and clipboard handling comes from parin_kit#174 (`core/file_share`), the pack writing from parin_kit#176. Until they land, keep the game's versions in one small module with `TODO: move to parin_kit, see parin_kit#174`. **Done when:** a level made in the web build on one computer can be downloaded, uploaded in the web build on another and played, and the same with the desktop build.
Author
Owner

Implemented with parin_kit#174 (core/file_share): download one/all, upload with the browser's file picker (desktop: list of .ccl files in Downloads), drops on every screen, share codes (copy/paste). The kit module was tested in headless Firefox; the game's buttons still need a try in a real browser, so this stays open until then.

Implemented with parin_kit#174 (core/file_share): download one/all, upload with the browser's file picker (desktop: list of .ccl files in Downloads), drops on every screen, share codes (copy/paste). The kit module was tested in headless Firefox; the game's buttons still need a try in a real browser, so this stays open until then.
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Weissstreifen/crystal_climb#12
No description provided.