Tilemap - detect unfilled tiles

0 favourites
  • 3 posts
From the Asset Store
Piano tiles
$9.99 USD
Template for a piano tiles game, fully documented in comments and video
  • Hi, does anyone familiar with the tilemap object know how to quickly detect if a tile is filled or not for use in conditions? i.e. filled meaning a tile which is present in the level and has solid behaviour for the player to stand on, unfilled is an empty space where a tile has not been drawn.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I rarely use this object because I'm no artist but I've figured out something, so leaving it here in case anyone else needs tips. There may be a better way but I've done it by comparing opacity, so opacity=100 appears to be anything filled while anything empty is opacity=0.

  • Also the TileAt expression returns -1 if there is no tile, so you can use:

    Tilemap.TileAt(Tilemap.PositionToTileX(Sprite.X), Tilemap.PositionToTileY(Sprite.Y)) < 0

    Disadvantage here is that the collision box is not checked, but only the exact XY Position. It seems the method with opacity only triggers when the collision box of an object actually touches the collision box of a tile, so it seems to be the much better and simpler solution. I did not know that, so thanks for the tip :)

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