Tiles game in jquery