<commit_before>// import Platform from 'objects/platform';
import { ASSETS } from 'constants';
import Bullet from 'objects/bullet';

export default class Player extends Phaser.Sprite {
  constructor(game, x, y) {
    const { world } = game;

    super(game, x, y, ASSETS.PLAYER, 1);

    game.physics.p2.enable(this, true);

    this.body.setRectangle(20);
    this.body.static = true;
    game.debug.body(this);

    this.spaceKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);

    this.bullet = new Bullet(game, x, y + 20);
    game.add.existing(this.bullet);
  }

  update() {
    if (this.spaceKey.isDown) {
      console.log('fire!')
      this.fireBullet();
    }
  }

  fireBullet() {
    this.bullet.body.velocity.x = 200;
  }
}

<commit_msg>Increase bullet speed for testing<commit_after>// import Platform from 'objects/platform';
import { ASSETS } from 'constants';
import Bullet from 'objects/bullet';

export default class Player extends Phaser.Sprite {
  constructor(game, x, y) {
    const { world } = game;

    super(game, x, y, ASSETS.PLAYER, 1);

    game.physics.p2.enable(this, true);

    this.body.setRectangle(20);
    this.body.static = true;
    game.debug.body(this);

    this.spaceKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);

    this.bullet = new Bullet(game, x, y + 20);
    game.add.existing(this.bullet);
  }

  update() {
    if (this.spaceKey.isDown) {
      console.log('fire!')
      this.fireBullet();
    }
  }

  fireBullet() {
    this.bullet.body.velocity.x = 500;
    // this.bullet.body.velocity.y = 200;
  }
}


{'fraction_non_alphanumeric': 0.14917825537294563, 'fraction_numerical': 0.01327433628318584, 'mean_word_length': 3.0279898218829517, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '881873', 'n_tokens_mistral': 586, 'n_tokens_neox': 547, 'n_words': 112}