99Instances2Go's Forum Posts

  • Render cells are usefull when used with layers that contain non moving objects. And a lot of non moving objects. A lot ? No, a big WORLD of non moving, static objects. Z-order is then maintainted once, only once.

    In fact, render cells are an improvement if you notice an improvement, else they are not. Thats the rule.

    About the 'hidden loops' you use. When there are 2 loops nested with counters that go from 0 to 9, that nested loop will run 100 times allready.

    Now, when you use 'Pick by evaluate', that is actual a loop, behind the scenes of course. It loops trough all (specified) objects and evaluates them. It is a fast loop, nevertheless a loop. Using families, that can be a bunch of objects. Using two families containing the same objects is actual a nested loop. 100 objects in the famelies = allready 10.000 times that it has to evaluate.

    Then you call the function. With again 2 'hidden loops'.

    Yeah that gets CPU demanding. For ALL objects in that family. If you really want to do this, then you to have filter both familys with the 'is on screen' before giving them to the first evaluate. That will allready do a lot.

    Oh, and, our friend Rex has a plugin to Z-order.

    http://c2rexplugins.weebly.com/rex_zsorter.html

  • You can call the function with parameters. Just add "S1L1" or "S1L2" as parameter. Have in mind that parameters (you can add many) are a list. All lists in C2 are zero based.

    Now, in the On function use two conditions

    System > Compared 2 values ...

    with ... function.param(0) = "S1L1"

    pick those with touch and do stuff on them

    System > Compared 2 values ...

    with ... function.param(0) = "S1L2"

    pick the others with touch

    Manual > Expression Param

    Retrieve a parameter passed to a function call by its zero-based index. For example, Function.Param(0) returns the value of the first parameter.

    You know wich one is dragged when you give them an instance variable, say, lets name it Level. Give it the value "S1L1" or "S1L2" in the layout.

    This way you can call the function with as parameter ... Object.Level (no if/thens, straight & easy)

  • Upload a capx.

  • Functions have 2 big advance.

    To minimize code lines.

    &

    To pick outside the piclkist made in the event with the call.

    The last reason is why i suggested the function. On dropped selects the object that is dropped. Not the object that it is dropped on. So, you can not reach that object until you make a new picklist. Now, the function always start to pick from scratch.

    Meaning, the mouse > cursor is over object .... will pick (and can pick) both objects.

  • Does the camera move ? Forcing you do do this on/off thing every tick ? That can be heavy, yes.

    What are the offscreen objects dooing?

    Is it a game with only interactions with 1 player object ? Or do they interact also with eachoter ?

  • You need those.

  • Uh, nope. Not pinned.

    The family does not exist in the container (can't), so it is not referenced. As a result all arrows re-pin.

    The green circle does not exist yet, created objects are actual created at the end of the tick, as result they pin to that one allready existing green circle, since the circle is not referenced.

    Use the 'on creation' for the green circle, and pin the arrows. They are picked with the right green circle because of the container.

    https://drive.google.com/open?id=0B1SSu ... FRxUkt4a3c

  • Yes that works.

    Just add a System> Once While True to that condition.

    Now, you start the animation from the beginning every tick, this is why you see only the first frame.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • About functions :

    https://www.scirra.com/manual/149/function

    About mouse object

    https://www.scirra.com/manual/114/mouse

    Add those objects to the project. Use them as i discribed.

  • 'unspace' it.

    C: While

    C: System compare 2 values .. find("string", " ") .. >< - 1

    A: replace("string", " ", "")

  • As you have noticed 'static' is ghosted for global variables. Makes no sense for global variables anywayz.

    Because 'static' is meant for local variables. Local variables are used in a subevent, on any sub level. A non 'static' local variable will reset everytime its top-event runs. A 'static' local variable will not reset. You can change a 'static' varaible anytime you want, als long as it is in its scope.

  • Can you do this with the spawning-sprite having a collssion mask of like 2 pixels by 2 pixels ?

    It is bit weird to make a conclusion out of wath is shown, it is drawing at the origin of a sprite with a relative big collission mask, so relative to the collission polygones its drawing at an ofset. There is also an 'average' happening.

    Also i dont see if you have a behavior on any of those sprites.

  • condition > On drop

    action > call function

    condtion > on function

    sub > cursor is over object

    action > destroy the object

  • Cap the lerp ?

    condition: System > compare 2 values .. distance(scrollx,scrolly,objplayerhelper.x,objplayerhelper.y) .. > .. 4

    action: do the lerp

    Dont renember exact name of that objplayerhelper.

    That way, the lerp will not move the camera arround in this shaded circomstances where it cant reach the distination.

  • Second question.

    You need to learn how to use Local Storage.

    https://www.scirra.com/tutorials/1461/h ... age-plugin