How do I Save this game ?

Get help using Construct 2

Post » Tue Jun 03, 2014 7:44 pm

Hello , Im new to construct 2 and i have this opensource project and i am learning from it alot but cant figure out some problems !

1.My first problem is i cant save unlocked levels and total hearts collected by user ( i used webstorage but there is this problem if u clear any level u got 3 heart for it and then if u repeat this level again u get 3 hearts again total 6 heart ! i want to be like this anytime user repeat that level get nothing cuz he or she already got 3 hearts on it)

2.My second problem i faced was there is weird issue with On collision with hearts i dont why this happen sometimes u got for one heart and get it but u get other heart(s) too even if u didnt collision with those u can see this by playing 4 5 level by yourself

I want to improve this project also i contact Jailson for this project too but he didnt respond to me (email )

Sorry for my english :)
Last edited by Behnam on Thu Jun 05, 2014 7:44 pm, edited 1 time in total.
B
3
Posts: 9
Reputation: 193

Post » Wed Jun 04, 2014 4:48 am

Anyone ?
B
3
Posts: 9
Reputation: 193

Post » Wed Jun 04, 2014 5:42 am

1) When setting 3 hearts add a condition that says something like:
= if hearts < 3
-> Action: Set hearts...
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Wed Jun 04, 2014 5:44 am

2) can u screenshot the code for whats supposed to happen when you collide with a heart?
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Wed Jun 04, 2014 7:10 am

Thank you for your reply

So i go for this heart

Image

But i getting the other heart too ! (two heart)

Image

I will post the code too .
B
3
Posts: 9
Reputation: 193

Post » Wed Jun 04, 2014 7:49 am

Here is code

Image

StartsCollected = Hearts Collected
B
3
Posts: 9
Reputation: 193

Post » Wed Jun 04, 2014 8:59 am

2) The code you have written should do as you want it. I don't know what can cause such issue. Do you mind to share your capx?

1) Add a behavior "Persist" to hearts. Collected hearts wont reappear when you do the same level over again.
There is an build-in example in C2. Simply open new project and search for persist.
Take a look at this manual aswell https://www.scirra.com/manual/161/persist
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,370

Post » Wed Jun 04, 2014 9:39 am

Here is capx .

****

Thank you for helping .
Last edited by Behnam on Thu Jun 05, 2014 7:44 pm, edited 1 time in total.
B
3
Posts: 9
Reputation: 193

Post » Wed Jun 04, 2014 4:27 pm

I want to create level selector like angry birds or other games like that . So if you repeat same level all of those stars (or hearts) there but i want to save your best record on that level and update total stars or hearts at level selector .
B
3
Posts: 9
Reputation: 193

Post » Wed Jun 04, 2014 5:13 pm

Behnam wrote:I want to create level selector like angry birds or other games like that . So if you repeat same level all of those stars (or hearts) there but i want to save your best record on that level and update total stars or hearts at level selector .

This video will help you https://www.youtube.com/watch?v=JJWWw9UMIs0

I am taking a look in your capx now
It's time for me to return the favor :)
B
32
S
9
G
9
Posts: 132
Reputation: 5,370

Next

Return to How do I....?

Who is online

Users browsing this forum: Jackriduk, kiki4construct and 22 guests