[Solved] Set colective tiles always over their respective

  • In my game i'm using normal maps for each tile. Using the container and adding the normal map.gfx no problem always that the tile is static. But when it moves?

    Actually i have something like:

    For each "Tile"

    "Tile" is moving -> Set "Tile_Normal" at "Tile" position.

    So only when the tile is moving will update the position, instead of use every tick to get better perfomance with a lot of tiles with normalMaps.

    The problem is that actually i have to do an individual event for each one of movable tiles. So i though, ok, using families, one for "tiles" and other for "Tile normals" . I changed the previous code event and some variations but nothing, always there is something wrong on some site :S .

    Question: Is there any way to do it with families or another way i'm missing?

  • These Tiles are sprites?

    I guess either using the pin behaviour, or using container, or referencing the normal maps by UID or another way of picking the right one would do..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, the tiles are sprites and actually all are using the container behaviour.

    Yes, and all this options works with individual sprites but not on families.

    I mean, i have: Tile1, Tile2, Tile3, Tile4, Tile5 and Tile_Normal1, Tile_Normal2, Tile_Normal3, Tile_Normal4 and Tile_Normal5.

    If on start layout i pin Tile_Normal1 to Tile1 all perfect, allways will go with it on moving or whatever but i will have to add one pin for all the objects i want to move.

    So the idea is add the Tile_Normal1 to the Tile1 container and add Tile_Normal1 to the Normal-Map-Family and use an event or something that pin automatically to all the spritees with a container inside the "NormalMap" family. THen i can add Tile_Normal2 to the Tile2 container and do in the other that always be pinned because that one event/condiction that say they have to be pinned.

    I don't know if i explained well XD . I want to pin all the normal maps over all the tiles adding in their respective container and using only one event/condition instead pin every one 1x1.

  • Would this work for you?

    for each family1

    pick nearest family2

    family2 pin to family1

  • Would this work for you?

    for each family1

    pick nearest family2

    > family2 pin to family1

    Not works or i'm doing some wrong, I made this:

    Is correct? The idea looks very good i really hope this works

    I made various changes about family1/2 and nothing all the combinations fail, not pin.

  • Arg! I thought i get it.

    Have in mind that in the game i have multiples tile1,etc... so at the start there is only one Tile1_Normal, is after when all the Tile1_Normal are created due the "container" of each Tile1.

    I say this because i added "F_NormalMaps on created -Z" at i get the last object pinned, but pinned with all the normaltiles XD, seems i'm getting somewhre, i hope....

  • You should pick the nearest to the position of the family..

    Here's an example with 2 sprites

    https://dl.dropboxusercontent.com/u/48563442/pinto.capx

  • Much thanks for the example but in my case only worked when i changed "on created" by "On start layout".

    I changed my condition of " F_NormalMaps On created" by "on start layout" and is working now. If i delete the condition "On start layout" not works i don't know why :S , but well is solved, thanks! very useful the Pick-Nearest! .

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