map generation and chunk edge detection

fixed map generation. each tiles position meets its position in general.

chunk edge is detected on right. still buggy