<commit_before>game.PlayerEntity = me.Entity.extend({
    init: function(x, y, settings){
        this._super(me.Entity, 'init', [x, y, {
                //height and width for player
                image: "player",
                width: 64,
                height: 64,
                spritewidth: "64",
                spriteheight: "64",
                getShape: function(){
                   return(new me.Rect(0, 0, 64, 64)).toPolygon();
                }
        }]);
       this.type = "PlayerEntity";
       this.health = game.data.playerHealth;
        this.body.setVelocity(game.data.playerMoveSpeed, 20);
        this.facing = "right";
        this.now = new Date().getTime();
        this.lastHit = this.now;
        this.dead = false;
        this.attack = game.data.playerAttack;
        this.lastAttack = new Date().getTime();
        me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH);
    
        this.renderable.addAnimation("idle", [78]);
        //animation for player walking
        this.renderable.addAnimation("walk", [117, 118, 119, 120, 121, 122, 123, 124, 125], 80);
        //animation for players attack
        this.renderable.addAnimation("attack", [65, 66, 67, 68, 69, 70, 71, 72], 80);
    
        this.renderable.setCurrentAnimation("idle");
    },
    
    update: function(delta){
        this.now = new Date().getTime();
        //updates my players health all the time
        if(this.health <= 0){
            this.dead = true;
           
        }
        
        if(me.input.isKeyPressed("right")){
            //sets the position of my x by adding the velocity defined above in
            //setVelocity{} and multiplying it by me.timer.ticker
            this.body.vel.x += this.body.accel.x * me.timer.tick;
            this.facing = "right";
            this.flipX(true);
        }else if(me.input.isKeyPressed("left")){
            //tells player to face left when moving left
            this.facing = "left";
            this.body.vel.x -=this.body.accel.x * me.timer.tick;
            this.flipX(false);
        }else{
            this.body.vel.x = 0;
        }
        //lets me jump and to fall so player wont be stuck in the air
        if(me.input.isKeyPressed("jump") && !this.jumping && !this.falling){<commit_msg>unefwqguyfbfgc<commit_after>game.PlayerEntity = me.Entity.extend({
    init: function(x, y, settings){
        this._super();
        this.setPlayerTimers();
        this.setAttributes();
        this.type = "PlayerEntity";
        this.setFlags();
        
        
        me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH);
    
        this.addAnimation();
    
    
        this.renderable.setCurrentAnimation("idle");
    },
    
    
     setSuper: function(){
            this._super(me.Entity, 'init', [x, y, {
                //height and width for player
                image: "player",
                width: 64,
                height: 64,
                spritewidth: "64",
                spriteheight: "64",
                getShape: function(){
                   return(new me.Rect(0, 0, 64, 64)).toPolygon();
                }
        }]);
     },
    
    setPlayerTimer: function(){
         this.now = new Date().getTime();
        this.lastHit = this.now;
        this.lastAttack = new Date().getTime();
    },
    
    setAttributes: function(){
        this.health = game.data.playerHealth;
        this.body.setVelocity(game.data.playerMoveSpeed, 20);
        this.attack = game.data.playerAttack;
    },
    
    setFlags: function(){
          this.facing = "right"
        this.dead = false;
    },
    
    addAnimation: function(){
        this.renderable.addAnimation("idle", [78]);
        //animation for player walking
        this.renderable.addAnimation("walk", [117, 118, 119, 120, 121, 122, 123, 124, 125], 80);
        //animation for players attack
        this.renderable.addAnimation("attack", [65, 66, 67, 68, 69, 70, 71, 72], 80);
    },
    
    update: function(delta){
        this.now = new Date().getTime();
        //updates my players health all the time
        if(this.health <= 0){
            this.dead = true;
           
        }
        
        if(me.input.isKeyPressed("right")){
            //sets the position of my x by adding the velocity defined above in
            //setVelocity{} and multiplying it by me.timer.ticker
            this.body.vel.x += this.body.accel.x * me.timer.tick;
            this.facing = "right";
            this.flipX(true);
        }else if(me.input.isKeyPressed("left")){
            //tells player to face left when moving left
            this.facing = "left";
            this.body.vel.x -=this.body.accel.x * me.timer.tick;
            this.flipX(false);
        }else{
            this.body.vel.x = 0;
        }
        //lets me jump and to fall so player wont be stuck in the air
        if(me.input.isKeyPressed("jump") && !this.jumping && !this.falling){
{'fraction_non_alphanumeric': 0.13490623109497882, 'fraction_numerical': 0.02702157693083283, 'mean_word_length': 1.6985854189336236, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1323157', 'n_tokens_mistral': 1617, 'n_tokens_neox': 1456, 'n_words': 342}