function Player(map, location) {
  this._map = map;
  this._location = location;

  var markerimage = new google.maps.MarkerImage(
      "res/icon.png",
      new google.maps.Size(48, 48));
  this._marker = new google.maps.Marker({
      position:location,
      map:map,
      title:"You",
      icon:markerimage,
      // TODO: shadow image.
    });
}

Player.prototype.locationChanged = function(position) {
  this._location = latLngFromPosition(position);
  this._marker.set_position(this._location);
}
var Player = Class.create({
  initialize: function(map, location) {
    this.map = map;
    this.location = location;
    
    var markerimage = new google.maps.MarkerImage(
        "res/icon.png",
        new google.maps.Size(48, 48));
    this.marker = new google.maps.Marker({
        position:this.location,
        map:this.map,
        title:"You",
        icon:markerimage,
        // TODO: shadow image.
      });
  },
  
  locationChanged: function(latLng) {
    this.location = latLng;
    this.marger.set_position(this.location);
  }
});
Convert the Player to a Prototype class.
Convert the Player to a Prototype class.