[SOLVED] Having a visual problem with overlapping ellipses

Well I cleaned up some of my code with the noSmooth() command and adding all the other code back in and I was able to accomplish what I was trying to do with the program, I was trying to make a circle being traced but the trace left a different color than the circle which is tracing it… I was able to accomplish this but not with a circle, with a square…

float CircleX = random(0,width);
float CircleY = random(0,height);
int XPlus = 1;
int YPlus = 1;
float TailX = 40;
float TailY = 40;
float Speed = 1;
float Tail = 40;
float SizeX = 20;
float SizeY = 20;
float BackGround = 50;
float EraseX;
float EraseY;

void setup() {
  fullScreen();
  background(BackGround);
  noSmooth();
}  

void draw() {
  
  // Collision and Boundary Restriction Logic //  

  if (CircleX>=width-(SizeX/2)) {XPlus=0; CircleX=width-(SizeX/2);}  

  if (CircleX<=0)   {XPlus=1; CircleX=0;}

  if (CircleY>=height-(SizeY/2)) {YPlus=0; CircleY=height-(SizeY/2);}

  if (CircleY<=0)   {YPlus=1; CircleY=0;}

  // Collision Reaction Logic // 

  if (XPlus==0) {CircleX=CircleX-Speed;}

  if (XPlus==1) {CircleX=CircleX+Speed;}

  if (YPlus==0) {CircleY=CircleY-Speed;}

  if (YPlus==1) {CircleY=CircleY+Speed;} 
  
  // Tail Logic //
  
  if (XPlus==0) {TailX=Tail;}

  if (XPlus==1) {TailX=-Tail;}

  if (YPlus==0) {TailY=+Tail;}

  if (YPlus==1) {TailY=-Tail;}
  
  // Erase Logic //
  
  if (XPlus==0) {EraseX=CircleX+Speed;}

  if (XPlus==1) {EraseX=CircleX-Speed;}

  if (YPlus==0) {EraseY=CircleY+Speed;}

  if (YPlus==1) {EraseY=CircleY-Speed;}
  
  // Visuals //
  
  noStroke();
  fill(100);
  rect(EraseX,EraseY,20,20);
  noStroke();
  fill(255);
  rect(CircleX,CircleY,SizeX,SizeY);
 
  // Debugging //
  
  println("--------");
  println();
  println();

}

void mousePressed() {
  exit(); 
}

**Update - I got it to work with the circle as well. **

1 Like