Search Unity

Tile based platformer without build in physics and colliders

Discussion in '2D' started by DJVDJV, Jun 10, 2019.

  1. DJVDJV

    DJVDJV

    Joined:
    Sep 11, 2014
    Posts:
    70
    Hi I am making "tile based" platformer without collider and without build in physics.
    What might be best way to detect "tiles" like:
    upload_2019-6-10_20-59-27.png

    Where brown is ground. Reds are enemys that moves on blue platform. And green is player.
    Anyways: "Tiles are 16x16" px and I want player / enemys moves smooth "pixel by pixel".

    Best practice for this?
     
  2. Primoz56

    Primoz56

    Joined:
    May 9, 2018
    Posts:
    369
    store your tile data in an array eg. public int[][] TileMap;

    each value will be a certain colour or whatever, then you move your character along this tilemap and detect whether they can fall down, move across, hit an enemy etc. Do not have moveable object as part of the tilemap, have them seperate eg. public Enemy enemies;