How do I destroy multiple tiles from a tilemap on overlap?

0 favourites
  • 2 posts
From the Asset Store
Each tile 64 by 64 pixels - Ultimate Tile Set for your awesome games
  • Sorry if this has been answered before as there seems to be a lot of variation in the forums on using tilemaps and collision and destroying tiles.

    Right now in my game I can destroy a tile in a tilemap by checking the X, Y of the collision (tilemap.PositionToTileX(collidingSprite.X) against the X, Y of the tile and destroying that tile no problem.

    But checking X/Y is one point, thus one tile at a time even if you're overlapping more than one tile. It's checking just the X/Y position of the overlapping collision rather than EVERYTHING that the collision is touching.

    Originally I've been using just tiles instead of a tilemap and it works perfectly and I get a solid 60fps on desktop and 60+ fps on Android. It's my iOS builds that suffer because of too many collision checks (forced to use iOS 8 builds atm as it's the only way to get a decent framerate). Using a tilemap reduces the checks by a huge margin, but I just can't get it to work the way I need it to.

    Any thoughts?

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That should have read 'Originally I've been using just *sprites* instead of a tilemap' <img src="{SMILIES_PATH}/icon_neutral.gif" alt=":|" title="Neutral">

    To get an idea of what I'm doing you can check out the trailer here:

    Subscribe to Construct videos now

    Nothing in that trailer I'm able to do with a tilemap (for the dirt) because I need to be able to destroy more than one at a time... but I mentioned that already <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

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