I have my isometric world represented by isometric tiles. If I were to allow the player to place buildings on any of the tiles how would I get this funcitonality to work?
I was thinking if I could add a MouseListener to the images?
I have my isometric world represented by isometric tiles. If I were to allow the player to place buildings on any of the tiles how would I get this funcitonality to work?
I was thinking if I could add a MouseListener to the images?
I would highly recommend not using the MouseListener on the images for one main reason: The graphics should only be a visual representation of what's happening in the game. Using the graphics to control the game creates high coupling between the graphics and the game, which will make it hard to modify or improve later down the road.
I would recommend using math to convert the mouse position to a game position like this article describes: http://www.tonypa.pri.ee/tbw/tut18.html