Wrote functions for moving in different directions.
Get locations (i.e., NumPy array indices) of moving objects.