<commit_before>import util from './util'
/*
 * A generic game object used as a basis for all objects instantiated with Pew
 * Should be extended to add functionality and overwrite collision methods
 *
 * @param opts
 *   Possible opts:
 *     - collidable
 *     - position vector {x, y}
 *     - speed (scalar) {x, y}
 *     - velocity (vector) {x, y} - generally -1 <-> +1
 *     - data
 *
 */

class GameObject {
  constructor(opts) {
    this.collidable = opts.collidable
    // TODO: enforce structure
    this.position = opts.position || { x: 0, y: 0 }
    // should be absolute valued
    this.speed = opts.speed || { x: 0, y: 0 }
    // defaults to no movement
    this.velocity = { x: 0, y: 0 }
    // TODO: scale, rotation, etc.

    // Generate uuid
    this._id = util.uuid()
    // generic optional data
    this.data = opts.data

  }
<commit_msg>add width to default game object<commit_after>import util from './util'
/*
 * A generic game object used as a basis for all objects instantiated with Pew
 * Should be extended to add functionality and overwrite collision methods
 *
 * @param opts
 *   Possible opts:
 *     - collidable
 *     - position vector {x, y}
 *     - speed (scalar) {x, y}
 *     - velocity (vector) {x, y} - generally -1 <-> +1
 *     - data
 *
 */

class GameObject {
  constructor(opts) {
    this.collidable = opts.collidable
    // TODO: enforce structure
    this.position = opts.position || { x: 0, y: 0 }
    // should be absolute valued
    this.speed = opts.speed || { x: 0, y: 0 }
    // defaults to no movement
    this.velocity = { x: 0, y: 0 }
    // TODO: scale, rotation, etc.
    // TODO: scale and width/height should not both be defined
    this.size = opts.size || {
      width: 100,
      height: 100
    }

    // Generate uuid
    this._id = util.uuid()
    // generic optional data
    this.data = opts.data

  }

{'fraction_non_alphanumeric': 0.12266666666666666, 'fraction_numerical': 0.011733333333333333, 'mean_word_length': 2.2289156626506026, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1021665', 'n_tokens_mistral': 606, 'n_tokens_neox': 573, 'n_words': 210}