itch.io is community of indie game creators and players

Devlogs

Loading And Saving Of Levels Now Work On Web Version

Duck Can't Swim
A browser game made in HTML5

23 Aug 2022 - After alot of struggle with saving I finally have something that works for WebGL. Started out by Using JSON files to store and load levels through StreamingAssets and PersistantPath and got it working on desktop. Apparently it did not work on WebGL for security reasons. Changed to using the UnityWebRequest system instead which I was able to get to work but there were no way to list all the items in the folders and when it came down to saving there were no easy fix unless using thrid party servers or javascript files and even then I wasnt sure I would get it to work. Then I turned towards the Playerprefs system which I rejected because it can only store basic types like int, float and strings. Then I realized the solution. I had to first use the JSON tool to serialize the 2D array which results in a string. Instead of using this string to save to JSON file I can use it to store to Playerprefs. So Finally I got a version where you can load all main levels that I provide as well as store your own creations and they should persist on next log in.

PLAY GAME HERE https://wolfheat.itch.io/duck-cant-swim

Files

  • DuckCantSwimV006.zip 36 MB
    Aug 23, 2022
Download Duck Can't Swim
Leave a comment