{"size": 613, "ext": "js", "max_stars_repo_path": "src/entities/player.js", "max_stars_repo_name": "PartyLich/space-invaders", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/entities/player.js", "max_issues_repo_name": "PartyLich/space-invaders", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/entities/player.js", "max_forks_repo_name": "PartyLich/space-invaders", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.4333333333, "max_line_length": 52, "alphanum_fraction": 0.6215334421}
import createDrawable from '../components/drawable';
import createMoveable from '../components/moveable';

/**
 * creates a player.
 * @param  {object} gameSize
 * @param  {number} gameSize.x
 * @param  {number} gameSize.y
 * @return {object}  a new player object
 */
const Player = function (gameSize) {
  const size = { x: 15, y: 15 };
  const center = {
    x: gameSize.x / 2,
    y: gameSize.y - size.y * 2,
  };

  const playerControlled = true;

  return Object.assign({},
      createDrawable(center, size),
      createMoveable(),
      {
        playerControlled,
      }
  );
};

export default Player;
