How do I save the state of multiple instances?

Get help using Construct 2

Post » Thu May 11, 2017 3:54 am

Let's say I have 5 sprites that each have their own specific frame, how do I save the info for the 5 sprites and load it?
0 0 0 0 0
\/\/\/\/\/
0 1 1 0 1
(Restart program)
0 1 1 0 1
yes.

__

|:D|

Gamjolt account:http://gamejolt.com/profile/masgame/409321/
B
35
S
14
G
3
Posts: 38
Reputation: 4,832

Post » Thu May 11, 2017 8:37 am

Store them in an array perhaps:

save:

event
For each sprite
action
push front of array, set x = sprite.asjson



load:
event
for 0 to array.width-1
action
create sprite on 0,0
set sprite from json string array.at(loopindex)



The array can be stored in a local storage if need be.


edit: subevent meant to be actions
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572


Return to How do I....?

Who is online

Users browsing this forum: Christmas and 25 guests