Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

la jauge de vie descend lorsquon est touche

  • Loading branch information...
commit 95ea55818cba0a2fb5e66829511eec53cb4be2dc 1 parent a0d0eca
unknown authored
Showing with 8 additions and 3 deletions.
  1. +1 −0  client/js/Mesh.js
  2. +7 −3 client/js/Player.js
View
1  client/js/Mesh.js
@@ -136,6 +136,7 @@ var ShootModel = function(player)
this.animationFrame = 0;
material = new THREE.ParticleCanvasMaterial( { color: 0xff0000, program: this.particleRender } );
shoot = new THREE.Particle(material);
+ shoot.owner = player.id;
shoot.rotation.x = shoot.rotation.z = 3*Math.PI/2;
shoot.position.x = player.position.x
shoot.position.y = player.position.y
View
10 client/js/Player.js
@@ -81,9 +81,13 @@ var Player = function(data)
var collision = THREE.Collisions.rayCastNearest( ray );
if (collision && Math.abs(collision.distance) < 50 && collision.distance != -1)
{
- var life = $("#lifeJauge").progressbar( "option", "value" );
- life = life - 10;
- $("#lifeJauge").progressbar({ value: life });
+ // remove life only if shooter_id != me
+ if (shoot.mesh.owner != game.me.id)
+ {
+ var life = $("#lifeJauge").progressbar( "option", "value" );
+ life = life - 10;
+ $("#lifeJauge").progressbar({ value: life });
+ }
return true;
}
return false;

0 comments on commit 95ea558

Please sign in to comment.
Something went wrong with that request. Please try again.