Commit e06d4591 authored by Gaurav Arora (gaa721)'s avatar Gaurav Arora (gaa721)
Browse files

fixed some bugs

parent e8fa3733
File mode changed from 100755 to 100644
......@@ -245,7 +245,7 @@ this.body.CreateFixture(this.fixtureDef);
(this.angle)-=temp/4;
}
}
this.velocity += dLeft /25;
this.velocity += dLeft /(25*(sPoint+1));
}
}
......@@ -282,7 +282,7 @@ this.body.CreateFixture(this.fixtureDef);
if(sPoint ==0 || sPoint==1)
this.velocity += dRight /25;
else
this.velocity += dRight /(25*(sPoint+1);
this.velocity += dRight /(25*(sPoint+1));
}
......
......@@ -503,7 +503,63 @@ var gamepads = navigator.getGamepads ? navigator.getGamepads() : (navigator.webk
if(gp.buttons[0].pressed)
}
else
{
if(gp.buttons[13].pressed)
{
prevPress=true;
}
if(prevPress)
{
if(!gp.buttons[13].pressed)
{
sPoint++;
if(sPoint==4)
sPoint=3;
prevPress=false;
}
}
if(gp.buttons[12].pressed)
{
prevPress1=true;
}
if(prevPress1)
{
if(!gp.buttons[12].pressed)
{
sPoint--;
if(sPoint==-1)
sPoint=0;
prevPress1=false;
}
}
// image(timg,ll + 75,30,timg.width*0.8,timg.height*0.8);
//UP key Released
}
if(gp.buttons[0].pressed)
{
if(sPoint==0)
......@@ -591,90 +647,6 @@ pop();
}
}
else
{
background(20);
if(!sCheck)
image(backimg[0],ll,0,backimg[0].width,backimg[0].height);
else
image(backimg[0],ll,0,backimg[0].width,backimg[0].height);
// image(timg,ll + 75,30,timg.width*0.8,timg.height*0.8);
if(gp.buttons[13].pressed)
{
sCheck=true;
}
if(gp.buttons[12].pressed)
{
sCheck=false;
}
//UP key Released
if(gp.buttons[0].pressed)
{
if(!sCheck)
{
boat=[];
boat.push(new createBoat(200,height/2,0,4));
boat.push(new createBoat(rl-ll-200,height/2,1,4));
return true;
}
else
{
boat=[];
boat.push(new createBoat(200,height/2,0));
boat.push(new createBoat(rl-ll-200,height/2,1));
//setting initial position
// boat[0].x = 100;
// boat[0].y = -500 ;
// boat[1].x = 400;
// boat[1].y = height/2 ;
return true;
}
}
else{
push();
translate(130,0);
fill(125,12,15);
textSize(40);
text("2 Player" ,ll+300,(height/2)-100);
text("4 Player" ,ll+300,(height/2)-50);
if(!sCheck)
triangle(ll+270,(height/2)-110,ll+270,(height/2)-120,ll+290,(height/2)-110);
else
triangle(ll+270,(height/2)-60,ll+270,(height/2)-70,ll+290,(height/2)-60);
// if(!sCheck)
// image(simg,ll+270,height/2-125,simg.width*0.01,simg.height*0.01);
// else
// image(simg,ll+270,height/2-75,simg.width*0.01,simg.height*0.01);
pop();
}
}
// console.log(boat.length);
for(var i=0;i<boat.length;i++)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment