<commit_before>game.module('game.player')
.require('game.b2dvec')
.body(function(){ 
    game.createClass('Player', {
        init: function(x, y) {
            this.sprite = new game.Sprite('logo.png', x, y, {
                width: 30, 
                height: 60,
                anchor: {
                    x: 0.5,
                    y: 0.5
                }
            });
            this.speed = 100;
            game.scene.addObject(this);
            this.sprite.addTo(game.scene.stage);

            //create a body using a body definition
            var bodyDef = new game.Box2D.BodyDef();
            bodyDef.position = new game.Box2D.Vec2(
                this.sprite.position.x * game.Box2D.SCALE,
                this.sprite.position.y * game.Box2D.SCALE
            ); 
            bodyDef.type = game.Box2D.Body.b2_dynamicBody;
            this.body = game.scene.Box2Dworld.CreateBody(bodyDef);
            //and the fixture
            var fixtureDef = new game.Box2D.FixtureDef;
            fixtureDef.shape = new game.Box2D.PolygonShape.AsBox(
                this.sprite.width / 2 * game.Box2D.SCALE,
                this.sprite.height / 2 * game.Box2D.SCALE
            );
            fixtureDef.density = 0.1;       //density has influence on collisions
            fixtureDef.friction = 0.5;      //A higher friction makes the body slow down on contact and during movement. (normal range: 0-1). 
            fixtureDef.restitution = 0;   //=Bounciness (range: 0-1).
            this.body.CreateFixture(fixtureDef);
        },

        update: function() {
            //The box2D world keeps track of the movement and position of the body.
            //use the update function to get the sprite in the right spot<commit_msg>prevent player body sleep<commit_after>game.module('game.player')
.require('game.b2dvec')
.body(function(){ 
    game.createClass('Player', {
        init: function(x, y) {
            this.sprite = new game.Sprite('logo.png', x, y, {
                width: 30, 
                height: 60,
                anchor: {
                    x: 0.5,
                    y: 0.5
                }
            });
            this.speed = 100;
            game.scene.addObject(this);
            this.sprite.addTo(game.scene.stage);

            //create a body using a body definition
            var bodyDef = new game.Box2D.BodyDef();
            bodyDef.position = new game.Box2D.Vec2(
                this.sprite.position.x * game.Box2D.SCALE,
                this.sprite.position.y * game.Box2D.SCALE
            ); 
            bodyDef.type = game.Box2D.Body.b2_dynamicBody;
            bodyDef.allowSleep = false;
            this.body = game.scene.Box2Dworld.CreateBody(bodyDef);
            //and the fixture
            var fixtureDef = new game.Box2D.FixtureDef;
            fixtureDef.shape = new game.Box2D.PolygonShape.AsBox(
                this.sprite.width / 2 * game.Box2D.SCALE,
                this.sprite.height / 2 * game.Box2D.SCALE
            );
            fixtureDef.density = 0.1;       //density has influence on collisions
            fixtureDef.friction = 0.5;      //A higher friction makes the body slow down on contact and during movement. (normal range: 0-1). 
            fixtureDef.restitution = 0;   //=Bounciness (range: 0-1).
            this.body.CreateFixture(fixtureDef);
        },

        update: function() {
            //The box2D world keeps track of the movement and position of the body.
            //use the update function to get the sprite in the right spot
{'fraction_non_alphanumeric': 0.10533707865168539, 'fraction_numerical': 0.020224719101123594, 'mean_word_length': 1.5148305084745763, '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': '2713065', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1017, 'n_words': 246}