I need help in >> level select

Get help using Construct 2

Post » Thu Jun 23, 2016 11:16 am

Hi Friends
In my game I have put level selection as per this tutorial
My game is complete and now available in Google Play Store
.
I have found a problem in my game

>>>>>>
In my game I have set
when we Win a popup comes in front of current level which shows Stars we have get and having three button of
a) go to home page
b) go to next level or
c) Restart game

>>>>>>
suppose i am in level 3, I won & Get 1 star then popup comes, When I click Restart button to play again, This time I get whatever stars 1, 2 or 3 those stars adding in 4 level, and if I again restart level 3 and gets any star its adding to 5 level and so on

>>>>>>
Reason is (may be)
I do not go to world section
i am just restarting game on standing over level 3
>>>>>>
May be, I have to add a condition where one every win 1 is adding to current level and value to level icon is settled as per stars we got. But I have no Idea What condition i have to add or any alternative idea of doing this. ??
>>>>>>
Please help me.

Capx
Last edited by luckyrawatlucky on Mon Jun 27, 2016 7:48 am, edited 1 time in total.
Image
B
68
S
40
G
48
Posts: 680
Reputation: 34,066

Post » Sat Jun 25, 2016 4:54 am

Bump
Image
B
68
S
40
G
48
Posts: 680
Reputation: 34,066

Post » Sun Jun 26, 2016 1:06 pm

Without seeing your capx file, there's not much anyone can do apart from 'guess' what the problem may be.

I'm going to 'guess' that you must have some variable set somewhere to the current level, or next level... maybe this variable is directing your stars to the wrong level?

Maybe it's going to the wrong part of the array and setting stars there? Maybe check when the level is complete if the row/column shift isn't happening in the array or something like that?

It would be more helpful if we had a capx to look at, or if you can make a simple capx to reproduce the problem so we can see it.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Mon Jun 27, 2016 7:48 am

Hi @SoldjahBoy
I have attached Capx
Image
B
68
S
40
G
48
Posts: 680
Reputation: 34,066

Post » Fri Jul 01, 2016 4:50 am

please help
Image
B
68
S
40
G
48
Posts: 680
Reputation: 34,066

Post » Sat Jul 02, 2016 8:04 am

bump
Image
B
68
S
40
G
48
Posts: 680
Reputation: 34,066

Post » Sat Jul 02, 2016 11:15 am

The working level save with correct star badge updating system:
https://www.dropbox.com/s/vh3n39sk8z2dh ... .capx?dl=0

I got stuck many times to get everything work correctly. But it finally done.
Last edited by alextro on Tue Jul 04, 2017 10:32 pm, edited 1 time in total.
ImageImage
B
111
S
51
G
24
Posts: 786
Reputation: 23,392

Post » Sat Jul 02, 2016 11:16 am

My triggerfinger is itching.
Because, well, you state the problem and then you add: It is probaly because i've been lazy.

Actually. You use 1 variable to represent current & next level ('currentLevel'). And you lossed track on it. If you had used two variables 'curLevel' & 'nextLevel', it would have been easyer to wrap you mind round it.

curLevel = well the current level
nextLevel = (curLevel + 1)

Now if you want to change some in the array for the current level, (like changing the stars)
it is located Array.at(curLevel,currentWorld)
Change something for the next level (like unlocking)
it is located Array.at(nextLevel,currentWorld)

Using 1 variable is ofcourse no problem, if you can wrap your mind arround it.

Change something (stars) for current level = Array.at(VariFORLevel,currentWorld)
Change something (unlocks) for next level = Array.at(VariFORLevel + 1,currentWorld)

On tap on Btn_Reload(x) .... add 0 to VariFORLevel
On tap on Next_level .... add 1 to VariFORLevel

You add 1 before the player made a choice, because you wanted to unlock next level in the array by using (the pretty lazy) Array.at(VariFORLevel,currentWorld) in stead of (more typing) Array.at(VariFORLevel + 1,currentWorld).
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests