How do I save an entire level to an JSON string and load it?

Get help using Construct 2

Post » Mon Apr 13, 2015 3:12 pm

Hi,
I want to create a Level Editor and create many levels for my game so i can then put them as a JSON string in my game and play the levels.
(I could create the levels faster this way)
Im really new to arrays and I don't know how to use them to get the coordinates of the objects (sprites etc.).
I found this Tutorial ( https://www.scirra.com/tutorials/585/ho ... vel-editor ) but it doesn't really describe how to do the things. :cry:
I also found this video on Youtube ( https://www.youtube.com/watch?v=2kQ27MZ-6nA ) which shows a Level Editor that's similar to that what i want to make. :D
It would be really nice if someone could describe exactly how to put the coordinates etc. of the levels objects into an array then save them into a JSON string and then load them again from the JSON string.
Thanks really much for replies! :D
Image
B
5
S
3
Posts: 193
Reputation: 1,063

Post » Mon Apr 13, 2015 6:39 pm

What you could do is save the JSON of each object to the array and then get the JSON of the entire array.
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 432
Reputation: 3,442

Post » Wed Apr 15, 2015 3:17 pm

@briggybros
Thanks for your reply!
I did it now :)
Image
B
5
S
3
Posts: 193
Reputation: 1,063


Return to How do I....?

Who is online

Users browsing this forum: bigezy80, brair_user, Google [Bot] and 13 guests