Tag Info

Hot answers tagged

8

Tiles and icons (even in UIs like window systems) are often in a size like 16x16 or 24x24 to make it easier to modify the tiles. Most times the tile size is a multiple of 8 because of the folowing reasons. It is relatively easy to shrink a tile with the size 32x32 to 16x16 by simply putting 4 pixels together (e.g. create the median/average of the 4 ...


6

This is a basic connected components problem, and can be solved with a single invocation of breadth-first or depth-first search, or any flood-fill algorithm. bool IsOneSolidShape(TileCollection tiles) { // Clear visited flags on all tiles. // (This can also be implemented as a temporary set/map or parallel array, // if you prefer not to clutter ...


3

Record the vertexes as lines on the edges where a shapes points lie. These will be used to match up to points/lines on the other tiles each time a tile changes. For example: Above the blue lines on the top two tiles, A and B, have been calculated/saved for each edge of the tile according the shape it contains (note even though they are on different sides ...


3

Here are the areas your nearest function associates with each tile: (assuming float % int is performed as a floating point modulo in your environment. If not, you can get broken/offset tiles instead, as visualized in the third image above) As a unit travels down and to the left, they briefly touch the stretched/offset corner of the tile below and to the ...


1

It seems you may have misunderstood the purpose of Tiled or tilemapping in general, so maybe I could clarify a bit for you. In simple terms, a tilemap is an array values that you use to construct your stage from an image (the tileset). It basically tells your code which part of the image to draw on the game screen. This way, you can reutilize your assets ...



Only top voted, non community-wiki answers of a minimum length are eligible