<commit_before>/*
 * bullet
*/
#ifndef BULLET_H
#define BULLET_H

#include "Arduboy.h"
#include "globals.h"
#include "bitmaps.h"

#define A_BULLET_DAMAGE 75
#define B_BULLET_DAMAGE 10

struct Bullet {
  public:
    byte posX;
    byte posY;
    byte damage;
    byte speedX;
    // Visibility (0), Direction (1)
    byte options;

    void set(byte x, byte y, boolean firedByPlayer, byte _damage) {
      posX = x;
      posY = y;
      damage = _damage;
      speedX = firedByPlayer ? 3 : 1;
      options |= 1 << 0;
      options |= firedByPlayer << 1;
    }

    void update() {
      if (isVisible()) {
        if (isMovingRight()) {
          posX += speedX;
          if (posX > arduboy.width()) {
            hide();
          }
        } else {
          posX -= speedX;
          if (posX <= 0) {
            hide();
          }
        }
      }
    }

    void draw() {
      if (isVisible()) {
        if (isMovingRight()) {
          drawBitmap(posX, posY, (damage == A_BULLET_DAMAGE ? playerBulletA : playerBulletB), 0);
        } else {
          drawBitmap(posX, posY, enemyBullet, 0);<commit_msg>Changes enemy bullet x speed from 1.0 to 0.7<commit_after>/*
 * bullet
*/
#ifndef BULLET_H
#define BULLET_H

#include "Arduboy.h"
#include "globals.h"
#include "bitmaps.h"

#define A_BULLET_DAMAGE 75
#define B_BULLET_DAMAGE 10

struct Bullet {
  public:
    float posX;
    byte posY;
    byte damage;
    float speedX;
    // Visibility (0), Direction (1)
    byte options;

    void set(byte x, byte y, boolean firedByPlayer, byte _damage) {
      posX = x;
      posY = y;
      damage = _damage;
      speedX = firedByPlayer ? 3 : 0.7;
      options |= 1 << 0;
      options |= firedByPlayer << 1;
    }

    void update() {
      if (isVisible()) {
        if (isMovingRight()) {
          posX += speedX;
          if (posX > arduboy.width()) {
            hide();
          }
        } else {
          posX -= speedX;
          if (posX <= 0) {
            hide();
          }
        }
      }
    }

    void draw() {
      if (isVisible()) {
        if (isMovingRight()) {
          drawBitmap(posX, posY, (damage == A_BULLET_DAMAGE ? playerBulletA : playerBulletB), 0);
        } else {
          drawBitmap(posX, posY, enemyBullet, 0);
{'fraction_non_alphanumeric': 0.12693498452012383, 'fraction_numerical': 0.0145953118089341, 'mean_word_length': 1.8134328358208955, 'pattern_counts': {'":': 0, '<': 13, '<?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': '195888', 'n_tokens_mistral': 825, 'n_tokens_neox': 794, 'n_words': 201}