title: Tron arcade game (Python, tkinter) - Collision detection
body: <p>I'm trying to program the Tron arcade game in Python with tkinter. 
  I'm having some problems with collision detection. My problem is that I'm not sure how to keep track of the tails, the players is drawing where ever they move.
  My first thought was to create a new list everytime I created a new rectangle. Then check these lists compared to the players location, each time they move. Though I'm not sure how I should write a loop, that will keep checking the new lists. 
  Then i found out it was possible to add a list, to another list. So I thought I could make one list with all the coordinates of the rectangles in it, but it seems like it just overwrites the old coordinates when ever they move, instead of adding it to it, even though I use append.
  I'm trying to do these things inside the function moving.</p>
  
  <p>This is how my code looks at the moment, without any code from the previous attempts I just described. Please tell me if you need any other information.</p>
  
  <pre><code>#   Imports
  from tkinter import*
  import datetime
  import math
  from time import sleep
  t = datetime.datetime.now
  
  #   Variables
  canvasHeight = 400
  canvasWidth = 400
  
  player1Spawn = 75, 200, 80, 205
  player2Spawn = 325, 200, 320, 205
  
  x1Move = 5
  y1Move = 0
  x2Move = -5
  y2Move = 0
  
  #   Window and canvas creation
  window = Tk()
  window.title("Tron")
  canvas = Canvas(height = canvasHeight, width = canvasWidth)
  
  canvas.pack()
  canvas.focus_set()
  
  #   Object creation
  player1 = canvas.create_rectangle(player1Spawn, fill = "blue", outline = "blue")
  player2 = canvas.create_rectangle(player2Spawn, fill = "red", outline = "red")
  
  #   Movement and tail creation
  def moving():
      global player1
      global player2
      global canvas
      p1Coords = canvas.coords(player1)
      p2Coords = canvas.coords(player2)
      p1CoordList = []
      p2CoordList = []
      p1CoordList.append(p1Coords)
      p2CoordList.append(p2Coords)
      canvas.create_rectangle(p1CoordList, fill = "blue", outline = "blue")
      canvas.create_rectangle(p2CoordList, fill = "red", outline = "red")
      del p1CoordList[0]
      del p2CoordList[0]
      canvas.move(player1, x1Move, y1Move)
      canvas.move(player2, x2Move, y2Move)
      window.after(50, moving)
  
  def moveVar(event):
      global x1Move
      global y1Move
      global x2Move
      global y2Move
  
      if event.keysym == "Up":
          x1Move = 0
          y1Move = -5
      elif event.keysym == "Down":
          x1Move = 0
          y1Move = 5
      elif event.keysym == "Right":
          x1Move = 5
          y1Move = 0
      elif event.keysym == "Left":
          x1Move = -5
          y1Move = 0
  
      if event.keysym == "w":
          x2Move = 0
          y2Move = -5
      elif event.keysym == "s":
          x2Move = 0
          y2Move = 5
      elif event.keysym == "d":
          x2Move = 5
          y2Move = 0
     elif event.keysym == "a":
          x2Move = -5
          y2Move = 0
  
  canvas.bind("&lt;KeyPress&gt;", moveVar)
  
  moving()
  </code></pre>