Save multiple variables in a single .json file

I’m making a level creator, and the main problem I’m having is saving the levels. The system I have works well, but whenever I save a level, instead of creating a new file with the new values (X/Y position, Angle…), it replaces the previous values. I tried saving the values ​​in json files, but apparently it can only save one value per file. Would there be any way to resolve this?

(I set it to create 2 json files temporarily precisely because with just 1 it wasn’t working, which would be ideal)

You can put everything into 1 structure /array variable and save it once. This is for storage. I don’t know how to the the file part but I’m assuming it would be similar.


Sorry for the delay in responding. i don’t know if its the same thing as in this post, but the thing i want is to all the values to be inside 1 json file, wich at the moment only stores 1 value. i tried maybe saving these values in multiple lines, but idk how to do it
i guess saving to storage dont allow these values to be saved in multiple files, as it is the method im using rn for the objects positions

testlevel - Bloco de Notas 01_06_2024 15_18_10

atm im trying to save the level theme (1-5) and the variable sonic style (false/true) in the same file, just to test if that is possible. if it is, it would be great to save the level objects position in here too