Tile map question (get tile)


(Adam Edney) #1

I have a tile map, which is 50 by 50, with 3 layers on it, one is the collision player, one is the good looking layer and the other one is for the AI / path finding.

How would I find if a layer is a 0 or a 1 in the "Grid exportMode=“Bitstring”.

If you can help it would be great.


(Zachary Lewis) #2
  • What map editor are you using?
  • Are you wanting to know how to find out if a tile is a 0 or a 1 in a FlashPunk Grid?
  • Have you written any code? If so, what isn’t working in the code?

(Adam Edney) #3

Thanks for the reply, im using ogmo editor. and the save file which have the 0’s and the 1’s look like this <1 exportMode="Bitstring">0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000011101110000000000000000000 0000000000001111111101000000000000000000 0000000000011110011111100000000000000000 0000000000100110100001101000000000000000 0000000000000100000000110000000000000000 0000000011001000000000011100000000000000 0000000000000100000000001100000000000000 0000000000001000000000001110000000000000 0000000000001000000000001010000000000000 0000000000011000000000001011000000000000 0000000000000000000000001010000000000000 0000000000101000000000010001000000000000 0000000000101000000000010011000000000000 0000000000001000000000100010000000000000 0000000010101000000011000101000000000000 0000000010000100001000000100000000000000 0000000100010001010000001001000000000000 0000000111011011000000110000000000000000 0000000000000000111111000010000000000000 0000000000001000000000000100000000000000 0000000000000100000000001000000000000000 0000000000000001100000010000000000000000 0000000000000000011101100000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000</1>

I want to find if a given cell is a 0 or a 1, e.g. something like this (if map.gettile(x,y).info == 1){// this means its a wall}

have any idea on how to do that?


(Zachary Lewis) #4

If you’re pushing them into a Grid, you can use Grid.getTile(column:uint = 0, row:uint = 0) to get a Boolean value of if the grid tile is solid (1).