Made the AI dumber

The AI now only follows the player if it is within a specified range.
When the AI hits a solid tile, it immediately changes direction. The
direction should not make it hit the same tile.

Also, some randomness has been added to the angle the AI chooses when it
follows the player.