Compare commits
No commits in common. "36f342a47d2a03eec3482e70ccf9674f97417901" and "3c47694f3db753a5ac296d20a5624cec5d085b46" have entirely different histories.
36f342a47d
...
3c47694f3d
3 changed files with 8 additions and 18 deletions
|
|
@ -41,12 +41,6 @@ class Player
|
|||
this.death++;
|
||||
this.health=defaulthealth;
|
||||
|
||||
players.forEach((p) => {
|
||||
if(p.id==killerId) {
|
||||
p.kill++;
|
||||
}
|
||||
});
|
||||
|
||||
net.died(this.id,killerId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,11 +98,10 @@ function updatePlayer(data)
|
|||
{
|
||||
player.x=data.x;
|
||||
player.y=data.y;
|
||||
if(data.z==undefined){
|
||||
if(data.z==undefined)
|
||||
player.z=0;
|
||||
} else {
|
||||
else
|
||||
player.z=data.z;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -112,11 +111,10 @@ function updatePlayer(data)
|
|||
{
|
||||
players[i].x=data.x;
|
||||
players[i].y=data.y;
|
||||
if(data.z==undefined){
|
||||
if(data.z==undefined)
|
||||
players[i].z=0;
|
||||
} else {
|
||||
else
|
||||
players[i].z=data.z;
|
||||
}
|
||||
players[i].dir=data.dir;
|
||||
players[i].visibleDir=data.visibleDir;
|
||||
break;
|
||||
|
|
@ -152,12 +150,10 @@ function addKill(idKilled,idKiller)
|
|||
player.death++;
|
||||
}
|
||||
players.forEach((p) => {
|
||||
if(p.id==idKilled) {
|
||||
if(p.id==idKilled)
|
||||
p.death++;
|
||||
}
|
||||
if(p.id==idKiller) {
|
||||
if(p.id==idKiller)
|
||||
p.kill++;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ class LeaderBoard {
|
|||
this.ctx.fillText((this.nbjoueur+1), this.px+10, this.py+120+20*this.nbjoueur);
|
||||
this.ctx.fillText(p.name, this.px+30, this.py+120+20*this.nbjoueur);
|
||||
this.ctx.fillText(p.kill, this.px+180, this.py+120+20*this.nbjoueur);
|
||||
this.ctx.fillText(p.id>0 ? p.death : "-", this.px+200, this.py+120+20*this.nbjoueur);
|
||||
this.ctx.fillText(p.id>0 ? Math.round(10*p.kill/p.death)/10 : "-", this.px+220, this.py+120+20*this.nbjoueur);
|
||||
this.ctx.fillText(p.death, this.px+200, this.py+120+20*this.nbjoueur);
|
||||
this.ctx.fillText(Math.round(10*p.kill/p.death)/10, this.px+220, this.py+120+20*this.nbjoueur);
|
||||
|
||||
this.nbjoueur++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue