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

Tips & tricks: working with files (loading and writing) #6

Open
CosmoMyzrailGorynych opened this issue Aug 19, 2019 · 3 comments
Open

Comments

@CosmoMyzrailGorynych
Copy link
Collaborator

CosmoMyzrailGorynych commented Aug 19, 2019

Though there is a way to save games with localStorage, sometimes it is needed to load/write external files. Though this topic is widely covered by a js community and not a subject to be covered by ct.js functionality (as every API is pretty high-level already and there is no point for adding new catmods or core API for that), it is not obvious for game developers as they expect this to be a part of a game engine.

What needs to be documented:

  • the use of include folder in ct.js projects;
  • the use of fetch API with examples of loading images & data from include and the web. Possible use cases/examples include:
  • working with the file system in desktop apps (ct.fs). Use cases/examples may include:
    • reading a directory's contents (e.g. discovering user-made levels);
    • writing and reading JSON files;
    • deleting files.

Possibly, fs functionality may be abstracted and presented as a ct.js API in ct.desktop.

@CosmoMyzrailGorynych
Copy link
Collaborator Author

See also https://github.com/ct-js/ct-js/issues/139 as it solves the same problem

@ghost
Copy link

ghost commented Feb 27, 2021

So how can I use the file system? I'm developing a game that will read user-made contents.

@CosmoMyzrailGorynych
Copy link
Collaborator Author

CosmoMyzrailGorynych commented Feb 28, 2021

@sketchysketch See docs for ct.fs module.

@CosmoMyzrailGorynych CosmoMyzrailGorynych moved this from Todo (Current release) to Not planned / Backlog in Overlook Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant