I’m trying to make a Save/Load system, and it works locally. For example, if you play, then you save, it saves. You can then press load and if you enter the save code, it will load. The problem is if you close the tab and open scratch in a new tab, the Code is now gone from the list along with the password. I want to know if there’s a way to make it so that you can even get on a different device to play and if you enter the password and save code, it will load your progress.
These are the code of my save and of my load buttons. I haven’t tried cloud variables, but I don’t think that would really help and I’m not sure about anything else
I’m trying to make a Save/Load system, and it works locally. For example, if you play, then you save, it saves. You can then press load and if you enter the save code, it will load. The problem is if you close the tab and open scratch in a new tab, the Code is now gone from the list along with the password. I want to know if there’s a way to make it so that you can even get on a different device to play and if you enter the password and save code, it will load your progress.
These are the code of my save and of my load buttons. I haven’t tried cloud variables, but I don’t think that would really help and I’m not sure about anything else
Share Improve this question edited Feb 21 at 4:25 ggorlen 58k8 gold badges114 silver badges157 bronze badges asked Feb 21 at 2:29 Leo CoxLeo Cox 31 bronze badge2 Answers
Reset to default 1Please be aware that Scratch does not save the contents of lists 'Codes' and 'Passwords' while/after playing. There is one exception: when the owner of the project (you) is inside the project editor ('look inside') while/after playing, and then saves the project (or the autosave kicks in), then list contents are saved inside the project, making them available to subsequent sessions.
In all other cases (project is not saved and/or player is not the owner), the list contents are not saved. New save codes will be lost, causing later attempts to load the game to fail.
You should probably reconsider your approach. The whole point of save codes is that you let the player save the code, not the program. If you want to prevent players to cheat by crafting their own save code, add a checksum.
Examples can be found in the Scratch wiki, in various Scratch projects, in the Scratch forums and on YouTube.
You would have to import cloud variables, but you have to use them carefully as only 4 total cloud variables may be used
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745170201a4614878.html
评论列表(0条)