Local storage

Hi there! I’m wondering how others go about saving their game in the background- my character has health/hunger and will hold things in inventory/purchase things…etc - would it be realistic to save every change in the game as it goes on? I’m a web dev so typically we would just save every state change to local storage that you want to have saved on a device but unfamiliar with games saving logic- ideally there wouldn’t only be a “save game” option to keep progress- incase the device dies or what have you- there’s a way to still have progress saved.

3 Likes

I mean there IS an extension that allows you to make save CODES. Not auto save though. I actually think that would depend on the device, since it would need some sort of clock battery to keep memory, and maybe for devices with a SD slot, maybe just maybe you might be able to write to that. Other than those things, I think its impossible.

3 Likes

Import the settings extension, it’s featured on makecode so just open the Extensions drawer and select it from there!

6 Likes

issue is if its a piece of hardware then it most likely wouldn’t save if it ran out of battery / was shut off since I dont think any makecode hardware has a clock battery. That does work on the website tho

1 Like

Hardware has flash storage, which retains storage… you don’t need a clock battery to save data

4 Likes

Oh, I guess I was thinking too much about the gb pokemon games which use a clock battery to store data.

1 Like