How do I Create Levels for a Mobile Game!

Get help using Construct 2

Post » Wed Dec 17, 2014 1:51 pm

Hi everyone,

I am trying to create a game with many levels but I also want my game save the progress of the player.

For example the player reaches level 66 but when the game is closed and reopened in the mobile phone the game again starts from level1 and all other levels are locked back!

So I am planning to make a World Map and the other levels are locked and they are opened as the player finishes the previous levels and so forth but at the same time the progress is always saved.
How can I manage to save the data in my game?? I looked some of the Database tools (arrays, webstorage etc.) but couldn't figure out.

I would appreciate the help.

Kind Regards
B
19
S
6
Posts: 179
Reputation: 2,202

Post » Wed Dec 17, 2014 3:59 pm

Why don't use System save/load state?
ImageImageImageImageImage
B
57
S
16
G
5
Posts: 852
Reputation: 11,536

Post » Wed Dec 17, 2014 5:23 pm

If your using global variables, it would be reset every time you close your app or browser.

Use the webstorage plugin.
I assume you have a global variable for 'levels'. In this example, ill call it: Global_level
In your event sheet, input a condition on WHEN you want it to save the 'level'.

For example, On your level complete trigger (which is your condition), your action would be: Set local/session value (under WebStorage actions).

Here you would set: WebStorage.LocalValue("level")

Set local value "level" to (Global_level) (This would be your global variable but obviously you named it differently)

Now, when you are playing your game, and you complete a level, it would be stored locally in your device or pc. (Unless you clear cache).

Now, remember to get the local value from Webstorage "level" everytime you start your game so that it remembers which level you left off from.

So in your event sheet: On start of layout: set (Global_level ) to the Webstorage's local value. (Type in Webstorage and find LocalValue, It'll will look something like this: Webstorage.LocalValue("level"). Make sure to type level in between "" indicating the what string value to retrieve.

Hope that helps,

Rich
B
6
Posts: 8
Reputation: 266

Post » Thu Dec 18, 2014 10:17 am

@Richard521 Thank You So Much for the advice I will definetly try it.

@Naji Thank you I will also try it. Does it work in a way that everytime the level ends I create a save state at the end of each level? So when the game is open it will reload where it was?
B
19
S
6
Posts: 179
Reputation: 2,202

Post » Thu Dec 18, 2014 7:11 pm

You can control save/load states anytime you want by the system's event and actions. Simply you can save a game triggered by an event and load it by an event! :D
ImageImageImageImageImage
B
57
S
16
G
5
Posts: 852
Reputation: 11,536

Post » Thu Dec 18, 2014 7:15 pm

@Naji Cool That looks pretty useful :)) I now see how they do that please select a game thing like they have 3 save slots especially for platform games and next time you can continue from the world you left :)) Thank You :))
B
19
S
6
Posts: 179
Reputation: 2,202

Post » Thu Dec 18, 2014 7:28 pm

your welcome, you can also add infinite game slots by just adding few events and a global variable :D Contact me or pm me anytime. I like to help others :D
ImageImageImageImageImage
B
57
S
16
G
5
Posts: 852
Reputation: 11,536

Post » Thu Dec 18, 2014 8:01 pm

Message: volcank can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Cool!! :-) Thank You So Much For The Help! :)

Below Are 2 of my games I created with Construct2 @googleplay If you would like to check out :))

Jumpy Shark
http://bit.ly/160kRL5

Altered Soccer
http://bit.ly/12nsQPY

As you might see they are limited my first try outs! :) So I want to make more complicated Games at least with many levels engagin games :)

Thank You once again.
B
19
S
6
Posts: 179
Reputation: 2,202


Return to How do I....?

Who is online

Users browsing this forum: dop2000, Kyatric and 6 guests