How to Save >> Template: Instance variable >> each clicks

0 favourites
  • 6 posts
From the Asset Store
Fruit Slicer Template & Quality fruit and slice graphics (capx,c3p,png,illustrator files)
  • A Template comes with Construct 2 ... Instance variable: Level Begineer

    in this Template each instance has their own click counting separately

    .

    But if i want to remember

    means i want to save all click of each instance with local storage

    than how we can do it

    .

    i have try this by myself but it saving only one "highest click" for each instance.

    pls tell me how we can do this

  • Just to be sure, you want the value of the instance variable of a sprite into a local storage?

  • in this file every instance is counting by a text file

    but now i want every instance should be remembered by local storage

    then how it could be possible ???

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In this particular case,it's easy..just use Array

    Template_InstanceVariable.capx

  • this is cool

    its saving

    but could you explain with comment in each event that what is that doing with command

    so that i can grab it for my practice

  • ..but could you explain with comment in each event that what is that doing..

    I'm sorry but I think that's a little bit excessive...

    BtnRestart on clicked-Restart Layout

    i think this is clear..also LocalStorage..

    On Start-check

    if missing -do someting

    if exists-get

    on get-do something

    only the array can be a little confusing..if you do not visualize how it actually looks

    so..in example you have 5 instance of same sprite..first instance always have IID=0;second=1

    just like frames in animation..array same case..first cell have index=0;second=1 etc

    so when you click on instance with IID=2..you save "clickCount"value in array on index 2

    then you save Array as Json...

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