<commit_before>var StartingPosition = (function (Transition) {
    "use strict";

    function StartingPosition(stage, sceneStorage) {
        this.stage = stage;
        this.sceneStorage = sceneStorage;
    }

    StartingPosition.prototype.checkPreConditions = function () {
        if (this.sceneStorage.speedStripes === undefined) {
            this.sceneStorage.speedStripes = showSpeedStripes(this.stage, 0);
        }
        if (!this.sceneStorage.ship) {
            this.sceneStorage.ship = this.stage.drawFresh(320 / 2, 400, 'ship');
        }
        if (!this.sceneStorage.fire) {
            this.sceneStorage.fire = this.stage.animateFresh(320 / 2, 400, 'fire-anim/fire', 8);
        }
        if (!this.sceneStorage.backGround) {
            this.sceneStorage.backGround = this.stage.drawFresh(320 / 2, 480 / 2, 'background', 0);
        }
    };

    StartingPosition.prototype.show = function (nextScene) {
        this.checkPreConditions();

        var self = this;
        var zero = 'num/numeral0';
        var spacing = Transition.EASE_IN_OUT_ELASTIC;
        var speed = 60;
        var yTop = 480 / 20;
        var yBottom = yTop * 19;
        var lifeX = 320 / 10;
        var lifeOneDrawable = self.stage.moveFreshLater(lifeX - lifeX * 2, yTop, 'playerlife', lifeX, yTop, speed, spacing, 20);
        var lifeTwoDrawable = self.stage.moveFreshLater(lifeX - lifeX * 2, yTop, 'playerlife', lifeX + 40, yTop, speed, spacing, 15);
        var lifeThreeDrawable = self.stage.moveFreshLater(lifeX - lifeX * 2, yTop, 'playerlife', lifeX + 80, yTop, speed, spacing, 10);
        var energyX = 320 / 5 + 5;
        var energyBarDrawable = self.stage.moveFresh(energyX - energyX * 2, yBottom, 'energy_bar_full', energyX, yBottom, speed, spacing);
        var digitX = 320 / 3 * 2 + 10;
        var firstDigit = digitX + 75;
        var firstDigitDrawable = self.stage.moveFreshLater(firstDigit + 60, yTop, zero, firstDigit, yTop, speed, spacing, 10);
        var secondDigit = digitX + 50;
        var secondDigitDrawable = self.stage.moveFreshLater(secondDigit + 60, yTop, zero, secondDigit, yTop, speed, spacing, 13);
        var thirdDigit = digitX + 25;
        var thirdDigitDrawable = self.stage.moveFreshLater(thirdDigit + 60, yTop, zero, thirdDigit, yTop, speed, spacing, 17);
        var fourthDigitDrawable = self.stage.moveFreshLater(digitX + 60, yTop, zero, digitX, yTop, speed, spacing, 12, false, function () {

            var lifeDrawablesDict = {1: lifeOneDrawable, 2: lifeTwoDrawable, 3: lifeThreeDrawable};
            var countDrawables = [firstDigitDrawable, secondDigitDrawable, thirdDigitDrawable, fourthDigitDrawable];

            self.next(nextScene, energyBarDrawable, lifeDrawablesDict, countDrawables)
        });
    };

    StartingPosition.prototype.next = function (nextScene, energyBarDrawable, lifeDrawablesDict, countDrawables) {
        this.sceneStorage.energyBar = energyBarDrawable;
        this.sceneStorage.lives = lifeDrawablesDict;
        this.sceneStorage.counts = countDrawables;

        nextScene();
    };

    function showSpeedStripes(stage, delay) {
        var speedStripes = [];

        speedStripes.push(drawSpeed(stage, 320 / 4, 0 + delay));
        speedStripes.push(drawSpeed(stage, 320 / 3 * 2, 34 + delay));
        speedStripes.push(drawSpeed(stage, 320 / 8 * 7, 8 + delay));
        speedStripes.push(drawSpeed(stage, 320 / 16 * 7, 24 + delay));
        speedStripes.push(drawSpeed(stage, 320 / 16, 16 + delay));

        return speedStripes;
    }

    function drawSpeed(stage, x, delay) {
        return stage.moveFreshLater(x, -108 / 2, 'speed', x, 480 + 108 / 2, 30, Transition.LINEAR, delay, true);
    }

    return StartingPosition;
})(Transition);<commit_msg>changed starting position scene rendering to use responsive constants instead of fix values<commit_after>var StartingPosition = (function (Transition, calcScreenConst) {
    "use strict";

    function StartingPosition(stage, sceneStorage) {
        this.stage = stage;
        this.sceneStorage = sceneStorage;
    }

    StartingPosition.prototype.checkPreConditions = function (screenWidth, screenHeight) {
        var __400 = calcScreenConst(screenHeight, 6, 5);
        var widthHalf = calcScreenConst(screenWidth, 2);

        if (this.sceneStorage.speedStripes === undefined) {
            this.sceneStorage.speedStripes = showSpeedStripes(this.stage, 0, screenWidth, screenHeight);
        }
        if (!this.sceneStorage.ship) {
            this.sceneStorage.ship = this.stage.drawFresh(widthHalf, __400, 'ship');
        }
        if (!this.sceneStorage.fire) {
            this.sceneStorage.fire = this.stage.animateFresh(widthHalf, __400, 'fire-anim/fire', 8);
        }
        if (!this.sceneStorage.backGround) {
            this.sceneStorage.backGround = this.stage.drawFresh(widthHalf, calcScreenConst(screenHeight, 2),
                'background', 0);
        }
    };

    StartingPosition.prototype.show = function (nextScene, screenWidth, screenHeight) {
        this.checkPreConditions(screenWidth, screenHeight);

        var self = this;
        var zero = 'num/numeral0';
        var spacing = Transition.EASE_IN_OUT_ELASTIC;
        var speed = 60;
        var yTop = calcScreenConst(screenHeight, 20);
        var yBottom = yTop * 19;
        var lifeX = calcScreenConst(screenWidth, 10);
        var lifeOneDrawable = self.stage.moveFreshLater(lifeX - lifeX * 2, yTop, 'playerlife', lifeX, yTop, speed,
            spacing, 20);
        var lifeOffSet = self.stage.getSubImage('playerlife').width;
        var lifeTwoDrawable = self.stage.moveFreshLater(lifeX - lifeX * 2, yTop, 'playerlife', lifeX + lifeOffSet, yTop,
            speed, spacing, 15);
        var lifeThreeDrawable = self.stage.moveFreshLater(lifeX - lifeX * 2, yTop, 'playerlife', lifeX + lifeOffSet * 2,
            yTop, speed, spacing, 10);
        var energyX = calcScreenConst(screenWidth, 32, 7);
        var energyBarDrawable = self.stage.moveFresh(energyX - energyX * 2, yBottom, 'energy_bar_full', energyX,
            yBottom, speed, spacing);
        var digitWidthHalf = calcScreenConst(self.stage.getSubImage('num/numeral0').width, 2);
        var digitX = calcScreenConst(screenWidth, 3, 2) + digitWidthHalf;
        var digitOffSet = calcScreenConst(self.stage.getSubImage('num/numeral0').width, 3, 4);
        var firstDigit = digitX + digitOffSet * 3;
        var screenOffSet = calcScreenConst(screenWidth, 5);
        var firstDigitDrawable = self.stage.moveFreshLater(firstDigit + screenOffSet, yTop, zero, firstDigit, yTop,
            speed, spacing, 10);
        var secondDigit = digitX + digitOffSet * 2;
        var secondDigitDrawable = self.stage.moveFreshLater(secondDigit + screenOffSet, yTop, zero, secondDigit, yTop,
            speed, spacing, 13);
        var thirdDigit = digitX + digitOffSet;
        var thirdDigitDrawable = self.stage.moveFreshLater(thirdDigit + screenOffSet, yTop, zero, thirdDigit, yTop,
            speed, spacing, 17);
        var fourthDigitDrawable = self.stage.moveFreshLater(digitX + screenOffSet, yTop, zero, digitX, yTop, speed,
            spacing, 12, false, function () {

            var lifeDrawablesDict = {1: lifeOneDrawable, 2: lifeTwoDrawable, 3: lifeThreeDrawable};
            var countDrawables = [firstDigitDrawable, secondDigitDrawable, thirdDigitDrawable, fourthDigitDrawable];

            self.next(nextScene, energyBarDrawable, lifeDrawablesDict, countDrawables)
        });
    };

    StartingPosition.prototype.next = function (nextScene, energyBarDrawable, lifeDrawablesDict, countDrawables) {
        this.sceneStorage.energyBar = energyBarDrawable;
        this.sceneStorage.lives = lifeDrawablesDict;
        this.sceneStorage.counts = countDrawables;

        nextScene();
    };

    function showSpeedStripes(stage, delay, screenWidth, screenHeight) {
        var speedStripes = [];
        var yOffSet = calcScreenConst(stage.getSubImage('speed').width, 2);
        speedStripes.push(drawSpeed(stage, calcScreenConst(screenWidth, 4), yOffSet, 0 + delay, screenHeight));
        speedStripes.push(drawSpeed(stage, calcScreenConst(screenWidth, 3, 2), yOffSet, 34 + delay, screenHeight));
        speedStripes.push(drawSpeed(stage, calcScreenConst(screenWidth, 8, 7), yOffSet, 8 + delay, screenHeight));
        speedStripes.push(drawSpeed(stage, calcScreenConst(screenWidth, 16, 7), yOffSet, 24 + delay, screenHeight));
        speedStripes.push(drawSpeed(stage, calcScreenConst(screenWidth, 16), yOffSet, 16 + delay, screenHeight));

        return speedStripes;
    }

    function drawSpeed(stage, x, yOffSet, delay, screenHeight) {
        return stage.moveFreshLater(x, - yOffSet, 'speed', x, screenHeight + yOffSet, 30, Transition.LINEAR, delay,
            true);
    }

    return StartingPosition;
})(Transition, calcScreenConst);
{'fraction_non_alphanumeric': 0.10980966325036604, 'fraction_numerical': 0.02455231444982543, 'mean_word_length': 3.0715268225584595, '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': '6180067', 'n_tokens_mistral': 2898, 'n_tokens_neox': 2626, 'n_words': 615}