MPU6050 | I²C CODE help

Greetings,
So I'm preparing a project, a gesture controlled car, the thing I'm having a problem with is that my adxl 335 got corrupted so I'm now using a mpu6050 with I²C and can't understand how to modify the code according to it.

Here's the normal code :arrow_down:

int xPin=A0;
int yPin=A1;

int out1=8; //output1 for HT12E IC
int out2=9; //output1 for HT12E IC
int out3=10; //output1 for HT12E IC
int out4=11; //output1 for HT12E IC

void setup(){
pinMode(xPin,INPUT);
pinMode(yPin,INPUT);

pinMode(out1,OUTPUT);
pinMode(out2,OUTPUT);
pinMode(out3,OUTPUT);
pinMode(out4,OUTPUT);
}

void loop()
{
int xval=analogRead(xPin);
int yval=analogRead(yPin);

if ((xval>294 && xval<340) && (yval>294 && yval<340)) //stop
{
digitalWrite(out1,LOW);
digitalWrite(out2,LOW);
digitalWrite(out3,LOW);
digitalWrite(out4,LOW);
}

else
{
if ((xval>340 && xval<380) && (yval>294 && yval<340)) //forward
{
digitalWrite(out1,HIGH);
digitalWrite(out2,LOW);
digitalWrite(out3,HIGH);
digitalWrite(out4,LOW);

}
if ((xval>345 && xval<294) && (yval>294 && yval<340)) //backward
{
digitalWrite(out1,LOW);
digitalWrite(out2,HIGH);
digitalWrite(out3,LOW);
digitalWrite(out4,HIGH);

}

if ((xval>294 && xval<340) && (yval>340 && yval<380)) //left
{
digitalWrite(out1,HIGH);
digitalWrite(out2,LOW);
digitalWrite(out3,LOW);
digitalWrite(out4,LOW);
}

if ((xval>294 && xval<340) && (yval>340 && yval<294))//right
{
digitalWrite(out1,LOW);
digitalWrite(out2,LOW);
digitalWrite(out3,HIGH);
digitalWrite(out4,LOW);

}
}
}

I tried looking the Web for various mpu projects but they were all using the gyro too, it made the learning too complicated.
If anyone could please tweak my code Acc. To the mpu6050, it'd be way more that helpful, or if u r willing to guide, I'll be way more than happy!

Please use code tags when posting code.. Look at this for info about the sensor and sample code.