<commit_before>define([
    'states/BaseState',
    'gameobjects/RobotGroup'
],function(BaseState,RobotGroup) {
    'use strict';

    function Fight() {
        BaseState.call(this);
        this.busy = true;
    }

    Fight.prototype = Object.create(BaseState.prototype);
    Fight.prototype.constructor = Fight;

    Fight.prototype.init = function(data){
        BaseState.prototype.init.call(this);

        this.enemyName = data.username;
        this.enemyRobotConfig = this.app.store.inject('Robot',data.robot).getConfig();

        this.playerName = this.app.user.username;
        this.playerRobotConfig = this.app.user.robot.getConfig();

        this.playerRobot = null;
        this.enemyRobot = null;

        this.buttonAttacck = null;
        this.buttonDefend = null;
        this.buttonItem = null;
        this.buttonAbort = null;
    };

    Fight.prototype.create = function(){
        console.log(this);

        this.enemyRobot = new RobotGroup(this.app.game,this.enemyRobotConfig);

        this.playerRobot = new RobotGroup(this.app.game,this.playerRobotConfig,true);
        this.playerRobot.x += this.enemyRobot.width;
    };

    return new Fight();
});<commit_msg>grundlegendes battle layout<commit_after>define([
    'states/BaseState',
    'gameobjects/RobotGroup'
],function(BaseState,RobotGroup) {
    'use strict';

    function Fight() {
        BaseState.call(this);
        this.busy = true;
    }

    Fight.prototype = Object.create(BaseState.prototype);
    Fight.prototype.constructor = Fight;

    Fight.prototype.init = function(data){
        BaseState.prototype.init.call(this);

        this.filterSrc = [

            "precision mediump float;",

            "uniform float     timeN;",
            "uniform vec2      resolution;",
            "uniform sampler2D iChannel0;",

            "void main( void ) {",

            "float t = timeN;",

            "vec2 uv = gl_FragCoord.xy / resolution.xy;",
            "vec2 texcoord = gl_FragCoord.xy / vec2(resolution.y);",

            "texcoord.y -= t*0.2;",

            "float zz = 1.0/(1.0-uv.y*1.7);",
            "texcoord.y -= zz * sign(zz);",

            "vec2 maa = texcoord.xy * vec2(zz, 1.0) - vec2(zz, 0.0) ;",
            "vec2 maa2 = (texcoord.xy * vec2(zz, 1.0) - vec2(zz, 0.0))*0.3 ;",
            "vec4 stone = texture2D(iChannel0, maa);",
            "vec4 blips = texture2D(iChannel0, maa);",
            "vec4 mixer = texture2D(iChannel0, maa2);",

            "float shade = abs(1.0/zz);",

            "vec3 outp = mix(shade*stone.rgb, mix(1.0, shade, abs(sin(t+maa.y-sin(maa.x))))*blips.rgb, min(1.0, pow(mixer.g*2.1, 2.0)));",
            "gl_FragColor = vec4(outp,1.0);",

            "}"
        ];

        this.filter = null;

        this.enemyName = data.username;
        this.enemyRobotConfig = this.app.store.inject('Robot',data.robot).getConfig();

        this.playerName = this.app.user.username;
        this.playerRobotConfig = this.app.user.robot.getConfig();

        this.background = null;

        this.playerRobot = null;
        this.enemyRobot = null;

        this.buttonAttack = null;
        this.buttonDefend = null;
        this.buttonItem = null;
        this.buttonAbort = null;
        this.buttonGroup = null;
    };

    Fight.prototype.preload = function(){
        this.load.spritesheet('buttonAttack','assets/spritesheets/angreifen.png',84,40);
        this.load.spritesheet('buttonDefend','assets/spritesheets/verteidigen.png',84,40);
        this.load.spritesheet('buttonAbort','assets/spritesheets/fluechten.png',84,40);
        this.load.spritesheet('buttonItem','assets/spritesheets/Item.png',84,40);
        this.load.image('circuitBoard','assets/tiles/platine.png');

    };

    Fight.prototype.create = function(){

        this.background = this.add.sprite(0,0,'circuitBoard');

        this.enemyRobot = new RobotGroup(this.app.game,this.enemyRobotConfig);
        this.app.scaleMax(this.enemyRobot,this.app.width/2.6,this.app.height,true);

        this.playerRobot = new RobotGroup(this.app.game,this.playerRobotConfig,true);
        this.app.scaleMax(this.playerRobot,this.app.width/1.3,this.app.height,true);

        var scale = (this.app.width/2) / 84;
        this.buttonAttack = this.add.button(0,0,'buttonAttack',null,null,0,0,1,0);
        this.buttonAttack.scale.set(scale,scale);

        this.buttonDefend = this.add.button(this.buttonAttack.width,0,'buttonDefend',null,null,0,0,1,0);
        this.buttonDefend.scale.set(scale,scale);

        this.buttonItem = this.add.button(0,this.buttonAttack.height,'buttonItem',null,null,0,0,1,0);
        this.buttonItem.scale.set(scale,scale);

        this.buttonAbort = this.add.button(this.buttonItem.width,this.buttonItem.y,'buttonAbort',null,null,0,0,1,0);
        this.buttonAbort.scale.set(scale,scale);

        this.buttonGroup = this.add.group();

        this.buttonGroup.add(this.buttonAttack);
        this.buttonGroup.add(this.buttonDefend);
        this.buttonGroup.add(this.buttonItem);
        this.buttonGroup.add(this.buttonAbort);

        this.buttonGroup.y = this.app.height - this.buttonGroup.height;

        this.background.width = this.app.width;
        this.background.height = this.buttonGroup.y;

        var customUniforms = {
            iChannel0: { type: 'sampler2D', value: this.background.texture, textureData: { repeat: true } },
            timeN: { type: '1f', value: 0 }
        };

        this.filter = new Phaser.Filter(this.app.game, customUniforms, this.filterSrc);
        this.filter.setResolution(this.background.height, this.background.width);

        this.background.filters = [this.filter];

        this.playerRobot.x = -(this.playerRobot.width/5);
        this.playerRobot.y = this.buttonGroup.y - (this.playerRobot.height/2);

        this.enemyRobot.x = this.app.width - this.enemyRobot.width;

    };

    Fight.prototype.update = function(){
        this.updateFP16Filter(this.filter);
        this.filter.update();
    };

    return new Fight();
});
{'fraction_non_alphanumeric': 0.14884800265208023, 'fraction_numerical': 0.01790154152163103, 'mean_word_length': 2.5831353919239906, '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': '4865751', 'n_tokens_mistral': 2067, 'n_tokens_neox': 1993, 'n_words': 260}