examples/3d/js/player.js
function(x, y, dir, speed) {
  this.x = x;
  this.y = y;
  this.dir = dir;
  this.speed = speed || 3;
  this.steps = 0;
  this.hand = new Texture('./assets/gun.png', 512, 360);

  // Update the position of the audio listener.
  Howler.pos(this.x, this.y, -0.5);

  // Update the direction and orientation.
  this.rotate(dir);
}
function(x, y, dir, speed) {
  this.x = x;
  this.y = y;
  this.dir = dir;
  this.speed = speed || 3;
  this.steps = 0;
  this.hand = new Texture('./assets/gun.png', 512, 360);

  // Update the position of the audio listener.
  Howler.pos(this.x, this.y, -0.5);

  // Update the direction and orientation.
  this.rotate(dir);
}
function ( x , y , dir , speed ) { this . x = x ; this . y = y ; this . dir = dir ; this . speed = speed || 3 ; this . steps = 0 ; this . hand = new Texture ( './assets/gun.png' , 512 , 360 ) ; // Update the position of the audio listener. Howler . pos ( this . x , this . y , - 0.5 ) ; // Update the direction and orientation. this . rotate ( dir ) ; }
The player from which we cast the rays.
@param {Number} x     Starting x-position.
@param {Number} y     Starting y-position.
@param {Number} dir   Direction they are facing in radians.
@param {Number} speed Speed they walk at.
The player from which we cast the rays .