Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

la jauge de vie descend lorsquon est touche

  • Loading branch information...
commit 95ea55818cba0a2fb5e66829511eec53cb4be2dc 1 parent a0d0eca
unknown authored

Showing 2 changed files with 8 additions and 3 deletions. Show diff stats Hide diff stats

  1. +1 0  client/js/Mesh.js
  2. +7 3 client/js/Player.js
1  client/js/Mesh.js
@@ -136,6 +136,7 @@ var ShootModel = function(player)
136 136 this.animationFrame = 0;
137 137 material = new THREE.ParticleCanvasMaterial( { color: 0xff0000, program: this.particleRender } );
138 138 shoot = new THREE.Particle(material);
  139 + shoot.owner = player.id;
139 140 shoot.rotation.x = shoot.rotation.z = 3*Math.PI/2;
140 141 shoot.position.x = player.position.x
141 142 shoot.position.y = player.position.y
10 client/js/Player.js
@@ -81,9 +81,13 @@ var Player = function(data)
81 81 var collision = THREE.Collisions.rayCastNearest( ray );
82 82 if (collision && Math.abs(collision.distance) < 50 && collision.distance != -1)
83 83 {
84   - var life = $("#lifeJauge").progressbar( "option", "value" );
85   - life = life - 10;
86   - $("#lifeJauge").progressbar({ value: life });
  84 + // remove life only if shooter_id != me
  85 + if (shoot.mesh.owner != game.me.id)
  86 + {
  87 + var life = $("#lifeJauge").progressbar( "option", "value" );
  88 + life = life - 10;
  89 + $("#lifeJauge").progressbar({ value: life });
  90 + }
87 91 return true;
88 92 }
89 93 return false;

0 comments on commit 95ea558

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