Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Pull request Compare This branch is 10 commits ahead of simart:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
SaveProgress.pde
index.html
processing.js
progress.txt

README.md

How to Save Progress

In this program we are saving the number of times that the page has been loaded, but we could use the same technique to store any kind of progress. Processing offers two functions that allow you to read and write to a file loadStrings and saveStrings. In this program we are reading and writing to a text file called progress.txt. The first time a user visits the page, we load the number 1 from progress.txt and display it to the screen. Then we increment the counter and save the increased value using saveStrings.

When we save the increased value, it is stored in the users web browser cache, not in the progress.txt file. This is called HTML storage or Web storage. This means that each users progress will be saved independently of any other users. Note that the size of the stored data is limited to 5Mb.

You can’t perform that action at this time.