title: I am trying to make the game tron in java, but the light trail behind the bike is not updating after the initial location of the bike
body: <p>So as the title states, I am trying to make the game tron for a programming final project. Everything works except for one crucial part, The light trail. I have a class for the light trail that takes the <code>x</code> and <code>y</code> locations of the player from a different class and draws a blue square in the players position. When I run and compile the program a square is drawn in the players starting position once the player is moved. However, the square does not draw again after the players first move.</p>
  
  <p>Here is my trail class</p>
  
  <pre><code>import java.util.*;
  import javax.swing.*;
  import java.awt.*;
  import java.awt.event.*;
  
  public class pTrail {
  
      player p;
      int x;
      int y;
      int c;
      Rectangle pT;
  
      public pTrail() {
          p = new player();
          x = p.getX();
          y = p.getY();
          pT = new Rectangle (x,y);
      }
  
      public Rectangle getRect() {
          return pT;
      }
  
      public void draw(Graphics2D g, Graphics2D g2) {
          g2.setColor(Color.blue);
          g2.fillRect(x,y,10,10);
      }
  }
  </code></pre>
  
  <p><code>int c</code> is designed to later be a variable to change the color of the trail.
  If you need more code then please comment what you need to see, driver, player etc. </p>