Fixed bug that cause collision detection to cause out of bounds error (related to tiles matrix)