rexrainbow's Forum Posts

  • Thanks for suggestion, I had made my first version of dictionary cache plugin.

    After loading cache completed, all read/write operations look likes synchronous.

    • Read had been done while cache loaded.
    • Writing actions in a tick would be fired at the same time ( in tick2() ). "Condition:On writing actions complete" will be triggered when all writing actions are done. User might wait this event or not.

    Data in local storage are-

    Sample capx , plugin.

    Edit

    The reading and writing actions of local storage are embedded inside this plugin. So it does not need to work with official localstorage plugin.

  • Ashley

    I could not get your point about writing.

    The writing action could be the same as local storage plugin. If the data had lose while using cache, it would be lose when using local storage plugin. Even "then" would lose them imo.

    The benefit of cache is to reduce the read complex.

    Edit:

    Writing action would update value in cache (memory) and also write it into local storage (disk).

  • Ashley

    "cache" is a small related data set. User picks this data set at the same time then read/write it (data in this set). Not to load whole storage data into cache imo. User could release it and reload new set manually.

    For writing action, each key-value is stored into different key of local storage, so that it does not write whole cache data into local storage, just one entry.

  • I had made a behavior which could predict the interception point of a target object. Here is a demo (sample capx).

    I prefer not to bind moving behavior which changing the position or angle of object, with strategy behavior which provide the reference information.

    For example, this behavior would provide a prediction position, and the moving behavior might use car behavior, custom moving, bullet+ set angle etc.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Update

    Add time away L plugin which get elapsed interval of turned off game from local storage.

  • A "cache" logic might reduce the response time and the complex of reading action.

    For example, a cache with dictionary structure -

    User could load this dictionary cache by reading all key-value pairs into memory, then these values could be read immediately.

    The structure stored in local storage might be

    • Index: A JSON sting to store the keys
    • Content: Key - value pairs

    Plugin first read index, then read all key-value pairs. And the manipulation of this dictionary cache is just like official dictionary object.

    Writing action might be triggered after ticking (in tick2() maybe), to write key-value pairs with dirty bit = 1.

  • I have another question-

    I set a value into webstorage every tick, it works fine.

    But in local storage, the hard disk rotates always with big noise.

  • It is reasonable, since the development team of scirra are only two people, they could not do all things.

    You might suggest that Ashley bought cocoonJS-Ludei, then C2 would have it's own wrapper.

  • indiegrimes

    It needs to get the position of the last character. I am not sure how hard to implement it in this behavior.

  • Arne

    Yes, I am trying something on cloud code which return number.

  • fisholith

    Behavior does not support AddVariadicParams(). You might add an action to push a parameter, so that user could call it many times to have a parameter array.

  • See the source code of official function plugin, line 172, line 260.

  • Arne

    Could you please change the type of expression:LastData from String to AnyType? So that it could receive string/number data back.

  • Inglorius

    I had made another version of boid behavior here.

  • Ashley

    It might ignore "action:set angle of motion" while property "set angle" is "Yes" in bullet behavior. And put this info into manual.

    In source code, "action:set angle of motion" would set this.dx, this.dy , which might not be allowed while "set angle" is "Yes", since this.dx, this.dy should be calculated by sprite.angle only.