Declaration error

Here i am again with some silly error which i am not able to figure while developing a ping pong code. I need help.

This is the error.

Arduino: 1.6.10 (Windows 10), Board: "Arduino/Genuino Uno"

bounceTheory:6: error: two or more data types in declaration of 'x'

 int x = 2;

     ^

C:\Users\Raebel Christo\Desktop\arduino programs\bounceTheory\bounceTheory.ino: In function 'void loop()':

bounceTheory:22: error: 'x' was not declared in this scope

   lc.setLed(0,x,y,true);

               ^

bounceTheory:23: error: 'p1lx' was not declared in this scope

   lc.setLed(0,p1lx,0,true);

               ^

bounceTheory:24: error: 'p1rx' was not declared in this scope

   lc.setLed(0,p1rx,0,true);

               ^

exit status 1
two or more data types in declaration of 'x'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

And this is the code…

#include<LedControl.h>
LedControl lc = LedControl(12,11,10,1);
int ButtonL=2;
int ButtonR=3;
boolean 
int x = 2;
int y = 4;
boolean gravity = false;
boolean wind = false;
int p1l = 3;
int p1r = 4;

void setup(){
  pinMode(ButtonL,INPUT);
  pinMode(ButtonR,INPUT);
  lc.shutdown(0,false);
  lc.setIntensity(0,3);
  lc.clearDisplay(0);
}

void loop(){
  lc.setLed(0,x,y,true);
  lc.setLed(0,p1lx,0,true);
  lc.setLed(0,p1rx,0,true);
  delay(200);
  if(x<1){wind = false;}
  if(wind == false){
    x++;
  }
  if(x>7){wind = true;}
  if(wind == true){
    x--;
  }
  if(y==0){gravity = false;}
  if(gravity == false){
    y++;
  }
  if(y>7){gravity = true;}
  if(gravity == true){
    y--;
  }
  lc.clearDisplay(0);
}
boolean 
int x = 2;

Exactly what it says - you're specifying two types for x. A variable must have one and only one type. You cannot declare something as both a boolean and an int.

It looks like maybe you were starting to declare another variable, but stopped after the first word. Since there's no semicolon, it treats it as part of the next line, and complains based on that.

You are also referring to p1lx and p1rx - those variables have never been declared (you have a p1l and p1r - is that what you meant?)

I corrected my error, no problem