# Java map generation

What is better way of setting up a map for a java 2D topdown game? Would it be having an ArrayList of tiles, a simple 2D array, a HashMap? (Note: the tiles/blocks or whatever are squared)

• While 1D works 2D is easier on the developer in terms of actual code. It's a lot easier to write [x][y] than to write [x +(y*width)] and the performance impact is exceedingly minimal. – Draco18s no longer trusts SE Jan 18 '16 at 18:17