{"size": 1021, "ext": "js", "max_stars_repo_path": "js/formats/player.js", "max_stars_repo_name": "rpgtoolkit/engine-html5", "max_stars_repo_stars_event_min_datetime": "2016-12-14T19:59:22.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-24T20:15:46.000Z", "max_issues_repo_path": "js/formats/player.js", "max_issues_repo_name": "rpgtoolkit/engine-html5", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "js/formats/player.js", "max_forks_repo_name": "rpgtoolkit/engine-html5", "max_forks_repo_forks_event_min_datetime": "2017-10-21T03:47:52.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-22T16:13:03.000Z"}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": 3, "avg_line_length": 29.1714285714, "max_line_length": 61, "alphanum_fraction": 0.7404505387}
Player.prototype = new Sprite();
Player.prototype.constructor = Player;

function Player(filename) {
  // TODO: Make the changes here that chrome suggests.
  var req = new XMLHttpRequest();
  req.open("GET", filename, false);
  req.overrideMimeType("text/plain; charset=x-user-defined");
  req.send(null);

  var player = JSON.parse(req.responseText);
  
  player.x = this.x;
  player.y = this.y;
  player.layer = this.layer;
  player.graphics = this.graphics;
  
  player.loadAnimations = this.loadAnimations;
  player._loadAnimation = this._loadAnimation;

  player.DirectionEnum = this.DirectionEnum;
  player.changeGraphics = this.changeGraphics;
  player.animate = this.animate;
  player.checkCollisions = this.checkCollisions;
  player.load = this.load;
  player.loadFrames = this.loadFrames;
  player.loadSoundEffects = this.loadSoundEffects;
  player.loadAssets = this.loadAssets;

  player.direction = this.DirectionEnum.SOUTH;
  player.setReady = this.setReady;
  player.renderReady = false;

  return player;
}