How do I Save this game ?

0 favourites
From the Asset Store
You must shoot down the enemy planes and eliminate them to earn points.
  • 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

  • Anyone ?

  • 1) When setting 3 hearts add a condition that says something like:

    = if hearts < 3

    -> Action: Set hearts...

  • 2) can u screenshot the code for whats supposed to happen when you collide with a heart?

  • Thank you for your reply

    So i go for this heart

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

    I will post the code too .

  • Here is code

    StartsCollected = Hearts Collected

  • 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

  • Here is capx .

    ****

    Thank you for helping .

  • 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 .

  • 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

    I am taking a look in your capx now

  • At lvl 1-1 if you try to pick up the upper heart, all three hearts will dissapear at once.

    Picking and destroying the oldest heart (lowest UID number) will teleport the newer hearts to the oldest heart position.

    At your event sheet "Level Sheet" line 14 is causing this issue. Simply delete that line will solve your problem. Cheers!

    Your game is looking great. Keep it up

  • You are awesome Really thank you for your taking your time and helping me really appreciate it .

    I checked that video you've posting ,I can save hearts levels and other stuff too now but the problem is repeating levels its acting weird hearts counted again and if i clear lvl 1-1 again lvl 1-2 hearts being cleared !! and totalstar(total hearts ) getting counted again . I know this is too much but can you please look into codes and find out whats wrong there ?

  • Could you upload your latest capx?

    I'll try to take a look into it tomorrow when I have time

  • Thank you

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Take a look at the event sheet "Scoresheet" line 25.

    This line does two things

    Action 1) Keep saying the next level has value 10 (zero hearts score/unlocked)

    Action 2) Set the score (ammount of collected hearts) for your current level

    You need to seperate these two actions with a proper condition by checking the score of the levels.

    At 1)

    Check if the next level have a value less than 10 in the array. If yes, action 1) will be triggered

    At 2)

    Compare "current collected hearts+10" value with the stored value of the current level. If "current collected hearts+10" is bigger than the stored value, Action 2 will be triggered.

    Something similar has to be done aswell for line 26.

    Good luck

    -----------

    I feel like sherlock holmes now

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)