How do I save completed levels ?

Get help using Construct 2

Post » Sun Aug 24, 2014 7:36 pm

Hi,

First of all, sorry for my english.

I worked for more than two months on a mobile game and I had completely forgotten the save option. And it's been several days I'm trying to solve my problem. I would like at the end of each level, the next level is unlocked.
I do not know at all how to do it (WebStorage? Array? Dictionnary?). I already watch this tutorial: /watch?v=JJWWw9UMIs0 , but all my levels are a different image and it's doesn't work.

So how to make the end of each level I unlock the next one. I just want to unlock the next level, and save the progression on the phone. (There is no scoring system)
(PS: it's a mobile game.)

Thank you !
B
5
Posts: 11
Reputation: 247

Post » Sun Aug 24, 2014 8:10 pm

Hi,
i had nearly the same problem.
Here is how i did it:

On Level finished event:
Image
("freigeschaltet" is a german word for unlocked)

im using a splash screen thats only showed when the app is started, on this layout i use
Image

and finally on the level select layout i did this:
Image

"locked" is a boolean varibale

p.s. please ignore the FGL part, i dont know why i included it in the screenshot

hope this helps!
if you have any questions fell free to ask :)
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Post » Mon Aug 25, 2014 9:05 am

Thank you !!

I'll try and I'll let you know !
B
5
Posts: 11
Reputation: 247

Post » Mon Aug 25, 2014 11:37 am

You can use an array to save your level info (for example 5*1*1 array for 5 levels you can save at each cell of the array a number you see proper(to me, 0 for locked, 1 for unlocked,2 for completed) then you need to save that array to webstorage by saving it as json file. don't worry, I think its easy and I'm nearly 17 years old. for more on how to that check this question I answered before : where-is-my-failure-webstorage-array_t113464
or ask for further help.
B
24
S
3
G
1
Posts: 67
Reputation: 2,946

Post » Mon Aug 25, 2014 8:30 pm

Hi thank you for your answers !

I began with the method of fldr and I have some problems. (I certainly forgot a part).

Here is what I've done :

My Level Select Event Sheet: To launch every level, I have a specific button, the manipulation is then different. Here is how I made (for the event 32, i made an error, it's Play2 -> set locked to false) :

1.PNG


I used for each "playbutton" sprite two instance variables. The boolean variable "unlocked" and the number variable "cur_lvl". (I put "false" for the first playbutton because the level is unlocked at the beginning). I add too on my first level two global variable (cur_level = 0 and cur_unlocked = 0 )

On the splash screen, I made as you :

2.PNG


And on the level, I made this :

3.PNG


When my guy is overlapping the finish flag, go to layout "missions" (level select), and put the boolean variable of playbutton2 (level 2) to false.

Where is the problem because it doesn't work. Thanks for your help ;)
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 11
Reputation: 247

Post » Tue Aug 26, 2014 6:44 pm

And I think it would be a good idea that daoudsami develop his method because I don't understand very well what you were saying with the arrays system ;)
B
5
Posts: 11
Reputation: 247

Post » Sat Aug 30, 2014 11:51 pm

Nobody ?!
B
5
Posts: 11
Reputation: 247

Post » Sun Aug 31, 2014 12:14 am

i will have a look at it tomorrow! its bed time here now ;)
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Post » Sun Aug 31, 2014 10:40 am

Ok, i slept enough now to tackle this :D
what seems to be the problem?
from what i see event 173 should be a subevent of 174 and the stuff that happens in 174 should go in subevent 175 under 173 (if you want to unlock the next level when the player finishes currentlevel and current level is the last unlocked level)
i think i could help you better if you gave me access to the capx, if you dont want me or someone to see the rest of the game, just exclude that parts and put them back in when the problem is solved
B
38
S
11
G
5
Posts: 485
Reputation: 5,340

Post » Sun Aug 31, 2014 7:35 pm

I created a project to train me a few days ago, maybe you could take a look and make your method.

That would be fantastic!

Here is the project test :
SaveTest.capx
You do not have the required permissions to view the files attached to this post.
B
5
Posts: 11
Reputation: 247

Next

Return to How do I....?

Who is online

Users browsing this forum: R0J0hound and 7 guests