How do I make a 'for every tile' with a tilemap object?

  • I know that it is possible to do this with arrays, but that just makes my game EXTREMELY slow(1-2 FPS) and I need a 'for every' with a tilemap object similar to 'for every item'.

  • Do you need that to happen constantly in the active game runtime? Or just once in a while, like, on layout start or on certain events?

    If you need that constantly, you'd need it to be a resource-heavy loop in any case, so it'd probably not be an ideal solution.

  • 1 to 2 fps means you made a few wrong assumptions about what is viable, so looping over a grid is not your biggest issue.

  • First of all, yes I want it to check CONSTANTLY. If that would be very resource demanding, what else can I do? I am trying to make it so if ANY tile on the tilemap is a certain tile, it spreads to blank tiles.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You haven't provided any information other than poor performance.

    Best guess would be literally the biggest thing in the game.

  • If that would be very resource demanding, what else can I do?

    In general, I'd say, go to the events that CAUSE any tile to change to that specific state and insert the desired action there instead of checking the ENTIRE tilemap constantly. If that's possible - tilemaps are a bit of a specific thing in Construct 2.

    If you want, maybe you can describe what exactly you are trying to achieve?

  • This is what I have so far (_https://www.dropbox.com/s/uhb898mzbu8tg3n/BuildingGame.capx?dl=0_). I am trying to make it so if ANY tile in the OBJECTS tilemap is the GRASS BLOCK tile and the tile above is the DIRT or GRASS BLOCK tile, it becomes a DIRT tile. Similar to the image below.

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