<commit_before>ig.module('game.entities.hero')
.requires(
  'impact.impact',
  'impact.entity',
  'game.config',
  'game.projectiles.bullet',
  'game.weapons.pistol',
  'game.weapons.shotgun',
  'game.weapons.rifle'
)
.defines(function() {
  EntityHero = ig.Entity.extend({
    // always draw a box around us
    _wmDrawBox: true,
    _wmBoxColor: 'rgba(255, 170, 66, 0.7)',

    // player always has this name
    name: 'hero',

    animSheet: new ig.AnimationSheet( 'media/hero.png', 32, 32 ),

    zIndex: 10,

    health: 10,

    // the size of our collider
    size: { x: 10, y: 32 },

    // the offset of collider
    offset: { x: 11, y: 0 },

    // movement variables
    maxVel: { x: 100, y: 800 },
    friction: { x: 2000, y: 0 },
    accel: { x: 0, y: 0 },

    // collision settings, collide against enemies
    type: ig.Entity.TYPE.A,
    checkAgainst: ig.Entity.TYPE.B,
    collides: ig.Entity.COLLIDES.PASSIVE,

    init: function( x, y, settings ) {
      this.parent( x, y, settings );

      // only do the below if were _not_
      // in the editor
      if(!ig.global.wm) {
        // setup animations
        this.addAnim( 'dodge', 0.1, [51, 52, 53, 54, 55, 56]);

        this.dodgeTimer = new ig.Timer();

        this.weapons = [
          new WeaponPistol(0,0, { player: this }),
          new WeaponShotgun(0,0, { player: this }),
          new WeaponRifle(0,0, { player: this })
        ];
        this.currentWeapon = 0;

        this.weapons[0].equip();
        console.log(this.anims);
      } else {
        this.addAnim('idle', 1, [0], true);
      }
    },

    receiveDamage: function(amt, other) {
      if(!this.isDodging) { // player cannot be hurt while dodging
        this.parent(amt, other);
      }
    },

    kill: function() {
      ig.game.hud.playerDead();
      this.parent();
    },

    getCurrentWeapon: function() {
      return this.weapons[this.currentWeapon];
    },

    flipMod: function() {
      return this.flip ? -1 : 1;
    },

    update: function() {
      var left = ig.input.state('left'),
        right = ig.input.state('right'),
        shoot = ig.input.pressed('shoot'),<commit_msg>rm logging code<commit_after>ig.module('game.entities.hero')
.requires(
  'impact.impact',
  'impact.entity',
  'game.config',
  'game.projectiles.bullet',
  'game.weapons.pistol',
  'game.weapons.shotgun',
  'game.weapons.rifle'
)
.defines(function() {
  EntityHero = ig.Entity.extend({
    // always draw a box around us
    _wmDrawBox: true,
    _wmBoxColor: 'rgba(255, 170, 66, 0.7)',

    // player always has this name
    name: 'hero',

    animSheet: new ig.AnimationSheet( 'media/hero.png', 32, 32 ),

    zIndex: 10,

    health: 10,

    // the size of our collider
    size: { x: 10, y: 32 },

    // the offset of collider
    offset: { x: 11, y: 0 },

    // movement variables
    maxVel: { x: 100, y: 800 },
    friction: { x: 2000, y: 0 },
    accel: { x: 0, y: 0 },

    // collision settings, collide against enemies
    type: ig.Entity.TYPE.A,
    checkAgainst: ig.Entity.TYPE.B,
    collides: ig.Entity.COLLIDES.PASSIVE,

    init: function( x, y, settings ) {
      this.parent( x, y, settings );

      // only do the below if were _not_
      // in the editor
      if(!ig.global.wm) {
        // setup animations
        this.addAnim( 'dodge', 0.1, [51, 52, 53, 54, 55, 56]);

        this.dodgeTimer = new ig.Timer();

        this.weapons = [
          new WeaponPistol(0,0, { player: this }),
          new WeaponShotgun(0,0, { player: this }),
          new WeaponRifle(0,0, { player: this })
        ];
        this.currentWeapon = 0;

        this.weapons[0].equip();
      } else {
        this.addAnim('idle', 1, [0], true);
      }
    },

    receiveDamage: function(amt, other) {
      if(!this.isDodging) { // player cannot be hurt while dodging
        this.parent(amt, other);
      }
    },

    kill: function() {
      ig.game.hud.playerDead();
      this.parent();
    },

    getCurrentWeapon: function() {
      return this.weapons[this.currentWeapon];
    },

    flipMod: function() {
      return this.flip ? -1 : 1;
    },

    update: function() {
      var left = ig.input.state('left'),
        right = ig.input.state('right'),
        shoot = ig.input.pressed('shoot'),
{'fraction_non_alphanumeric': 0.15742690058479533, 'fraction_numerical': 0.02994152046783626, 'mean_word_length': 2.1580502215657313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1520047', 'n_tokens_mistral': 1632, 'n_tokens_neox': 1475, 'n_words': 362}