Code Monkey home page Code Monkey logo

Comments (9)

binji avatar binji commented on May 24, 2024 1

I added saving to simple.js in this commit: b2ef17f.

It uses localStorage under the hood, and only uses one save file (not one-per game). But I think it should work for your use case.

from binjgb.

binji avatar binji commented on May 24, 2024

Yes, it's happening because I removed save support from the simple example I showed you. :-)

It shouldn't be too much work to add it back in, but I won't have time to do it for a little while. Basically all the stuff in demo.js called extRam* needs to be added back in, as well as reading/writing to indexeddb.

from binjgb.

ChefFloyardee avatar ChefFloyardee commented on May 24, 2024

Thank you so much for getting back to me!

My students are the main ones who play my ROM and use the emulator, and one of them lost their save file and was crushed since they put so much hard work into it! I was heartbroken as well, since it brought back memories from my Game Boy days when the cart batteries would die!

Any who, this is great to hear! Let me know when you get a chance to fix it so we can work to get my page's code back where it needs to be!

In the meantime I guess I will have to use this as a reason to teach them about perseverance in the face of adversity! (Either that or make them their own ROM files that give them their high-leveled Pokemon back!) :D

from binjgb.

ChefFloyardee avatar ChefFloyardee commented on May 24, 2024

Thank you so much!

Can I just copy and paste this into my simple.js file, or should I delete mine, download yours, and then try re-uploading it?

from binjgb.

binji avatar binji commented on May 24, 2024

The changes are pretty small, you should be able to copy-paste them to your version.

from binjgb.

ChefFloyardee avatar ChefFloyardee commented on May 24, 2024

Thank you so much!

I will try this now and fingers-crossed for now more lost save files :D :D :D

from binjgb.

binji avatar binji commented on May 24, 2024

Happy to help!

from binjgb.

cyberic99 avatar cyberic99 commented on May 24, 2024

Hi binji.

would it be possible to add a button to upload a .sav file (while powered off) and to download the current .save file?

thanks!

from binjgb.

ChefFloyardee avatar ChefFloyardee commented on May 24, 2024

from binjgb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.