title: Why is the tower defense path all messy when I try to eliminate the tower placment on the path?
body: <p>I want to finish my tower defense game as fast as I can.
  I have trouble with if the tower is on the path with a given path list.
  It will never work even is I try as hard as I can.</p>
  
  <p>I already tried a lot of times to solve that problem like tech with tim's tower defense youtube tutorial. It made almost perfect sense why it was not working.
  But no matter how hard I try, It seems to never work properly.
  Find the link to the tutorial <a href="http://www.youtube.com/watch?v=iLHAKXQBOoA" rel="nofollow noreferrer">here</a>.
  WARNING:The video is pretty long.</p>
  
  <pre><code>x, y = tower.x, tower.y
  for n, point in enumerate(path):
      point_x, point_y = point[0], point[1]
      dis_x = abs(point_x - x)
      dis_y = abs(point_y - y)
      dis = math.sqrt((dis_x - x)**2 + (dis_y - y)**2)
      print(dis)
      if dis &lt; 130:
          return False
  return True
  </code></pre>
  
  <p>You might be thinking 'Why did I do this' so I changed it a bit:</p>
  
  <pre><code>import numpy as np
  closest = []
  x, y = tower.x, tower.y
  for n, point in enumerate(path):
      point_x, point_y = point[0], point[1]
      dis_x = abs(point_x - x)
      dis_y = abs(point_y - y)
      dis = math.sqrt((dis_x - x)**2 + (dis_y - y)**2)
      print(dis)
      if len(closest) &lt;= 2:
          if dis &lt; 130:
              closest.append(point)
  p1 = np.array([x, y])
  p2 = np.array(closest[0])
  p3 = np.array(closest[1])
  dis = np.cross(p2-p1,p3-p1)/np.linalg.norm(p2-p1)
  if dis &lt; 90:
      return False
  return True
  </code></pre>
  
  <p>I did not recive any error messages, but you can still place towers on some spots on the path,
  and you can't place towers on some points not on the path, and I was expecting it to be pretty neat.</p>