Added a bit of code to deal with tiles in game logic