<commit_before>from .shaders import ShaderProgram
from .behaviors.ball import Ball

from nytram.entity import Entity
from nytram.renderers import EntityRenderer
from nytram.ext.box2d import Body, Fixture, BodyTypes, Box
from nytram.ext.box2d.movement import DirectionalMovement, InstantVelocity

class BallEntity:
    """ Helper to load the Ball Entity """
    renderer = None
    
    @classmethod
    def loadRenderer(cls):
        """ Load the renderer """
        cls.renderer = EntityRenderer(ShaderProgram, elements=[0,2,1,3,0,1], vertexData={0:[.5, .5, 0, -.5, -.5, 0, .5, -.5, 0, -.5, .5, 0]})
    
    @classmethod
    def build(cls, scene, position):
        """ Build the Entity """
        entity = Entity(scene, renderer=cls.renderer)
        fixture = Fixture(Box(2, 2), density=1, restitution=1, isSensor=False, userData=1)
        entity.body = Body([fixture], bodyType=BodyTypes.Dynamic, fixedRotation=True)
        entity.transform.position = position
        # entity.movement = DirectionalMovement([0,1], InstantVelocity(3))
        entity.ball = Ball()
        return entity
        
# BallEntity.loadRenderer()<commit_msg>Fixed the Ball Entity so its collider is the proper size<commit_after>from .shaders import ShaderProgram
from .behaviors.ball import Ball

from nytram.entity import Entity
from nytram.renderers import EntityRenderer
from nytram.ext.box2d import Body, Fixture, BodyTypes, Box
from nytram.ext.box2d.movement import DirectionalMovement, InstantVelocity

class BallEntity:
    """ Helper to load the Ball Entity """
    renderer = None
    
    @classmethod
    def loadRenderer(cls):
        """ Load the renderer """
        cls.renderer = EntityRenderer(ShaderProgram, elements=[0,2,1,3,0,1], vertexData={0:[.5, .5, 0, -.5, -.5, 0, .5, -.5, 0, -.5, .5, 0]})
    
    @classmethod
    def build(cls, scene, position):
        """ Build the Entity """
        entity = Entity(scene, renderer=cls.renderer)
        fixture = Fixture(Box(1, 1), density=1, restitution=1, isSensor=False, userData=1)
        entity.body = Body([fixture], bodyType=BodyTypes.Dynamic, fixedRotation=True)
        entity.transform.position = position
        # entity.movement = DirectionalMovement([0,1], InstantVelocity(3))
        entity.ball = Ball()
        return entity
        
# BallEntity.loadRenderer()
{'fraction_non_alphanumeric': 0.12269412269412269, 'fraction_numerical': 0.024882024882024883, 'mean_word_length': 3.358878504672897, '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': '736703', 'n_tokens_mistral': 742, 'n_tokens_neox': 719, 'n_words': 191}