<commit_before>
import Morph from "./Morph.js"


export default class Ball extends Morph {

  initialize() {
    this.windowTitle = "Bouncing Ball"
    this.hits = 0
    if (!this.balls)
      this.balls =  [{dx: 1, dy: 2, y: 150, x: 10}]
  }
  
  attachedCallback() {
    this.animation = setInterval(() => this.draw(), 20);
  }
  
  detachedCallback() {
    clearInterval(this.animation)
  }
  
  draw() {
    var context = $(this.shadowRoot).find("#bouncing-ball")[0].getContext('2d');
    context.clearRect(0, 0, 300, 300);

    if (!this.balls) return
    this.balls.forEach(ball => {
        context.beginPath();
        context.fillStyle = "gray";
        context.arc(ball.x, ball.y, 10, 0, Math.PI*2, true);
        context.closePath();
        context.fill();
        this.collisionTest(ball)
        ball.x += ball.dx;
        ball.y += ball.dy;<commit_msg>misc<commit_after>
import Morph from "./Morph.js"


export default class Ball extends Morph {

  initialize() {
    this.windowTitle = "Bouncing Ball"
    this.hits = 0
    if (!this.balls)
      this.balls =  [{dx: 1, dy: 2, y: 150, x: 10}]
  }
  
  attachedCallback() {
    this.animation = setInterval(() => this.draw(), 20);
  }
  
  detachedCallback() {
    clearInterval(this.animation)
  }
  
  draw() {
    var context = $(this.shadowRoot).find("#bouncing-ball")[0].getContext('2d');
    context.clearRect(0, 0, 300, 300);

    if (!this.balls) return
    this.balls.forEach(ball => {
        debugger
        context.beginPath();
        context.fillStyle = "gray";
        context.arc(ball.x, ball.y, 10, 0, Math.PI*2, true);
        context.closePath();
        context.fill();
        this.collisionTest(ball)
        ball.x += ball.dx;
        ball.y += ball.dy;
{'fraction_non_alphanumeric': 0.16417910447761194, 'fraction_numerical': 0.027554535017221583, 'mean_word_length': 2.4721115537848606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '908724', 'n_tokens_mistral': 646, 'n_tokens_neox': 585, 'n_words': 126}