<commit_before>// namespace
var App = App || {};

App.HUD = (function () {
    "use strict";

    var fn = function (game) {
        this.game = game;
    };

    fn.prototype.loadAssets = function () {
        this.game.load.image('healthbarBgLeft', 'assets/images/hud_elements/barHorizontal_shadow_left.png');
        this.game.load.image('healthbarBgMid', 'assets/images/hud_elements/barHorizontal_shadow_mid.png');
        this.game.load.image('healthbarBgRight', 'assets/images/hud_elements/barHorizontal_shadow_right.png');
        this.game.load.image('healthbarGreenLeft', 'assets/images/hud_elements/barHorizontal_green_left.png');
        this.game.load.image('healthbarGreenMid', 'assets/images/hud_elements/barHorizontal_green_mid.png');
        this.game.load.image('healthbarGreenRight', 'assets/images/hud_elements/barHorizontal_green_right.png');
    };

    fn.prototype.displayHUD = function () {
        this.group = this.game.add.group();

        var healthbarXPos = 5;
        var healthbarYPos = 5;

        this.healthbarBgLeft = this.game.add.sprite(healthbarXPos, healthbarYPos, 'healthbarBgLeft');
        this.healthbarBgLeft.fixedToCamera = true;
        this.group.add(this.healthbarBgLeft);

        this.healthbarBgMid = this.game.add.sprite(healthbarXPos + this.healthbarBgLeft.width, healthbarYPos, 'healthbarBgMid');
        this.healthbarBgMid.fixedToCamera = true;
        this.healthbarBgMid.width = 400;
        this.group.add(this.healthbarBgMid);

        this.healthbarBgRight = this.game.add.sprite(healthbarXPos + this.healthbarBgMid.width + this.healthbarBgLeft.width, healthbarYPos, 'healthbarBgRight');
        this.healthbarBgRight.fixedToCamera = true;
        this.group.add(this.healthbarBgRight);
    };

    return fn;
})();
<commit_msg>added green healthbar to hud<commit_after>// namespace
var App = App || {};

App.HUD = (function () {
    "use strict";

    var fn = function (game) {
        this.game = game;
    };

    fn.prototype.drawHealthBar = function (x, y, maxHealth, healthbarType) {
        this.left = this.game.add.sprite(x, y, healthbarType + 'Left');
        this.left.fixedToCamera = true;
        this.group.add(this.left);

        var midXPos = x + this.left.width;
        this.mid = this.game.add.sprite(midXPos, y, healthbarType + 'Mid');
        this.mid.fixedToCamera = true;
        this.mid.width = maxHealth;
        this.group.add(this.mid);

        var rightXPos = x + this.mid.width + this.left.width;
        this.right = this.game.add.sprite(rightXPos, y, healthbarType + 'Right');
        this.right.fixedToCamera = true;
        this.group.add(this.right);
    };

    fn.prototype.loadAssets = function () {
        this.game.load.image('healthbarBgLeft', 'assets/images/hud_elements/barHorizontal_shadow_left.png');
        this.game.load.image('healthbarBgMid', 'assets/images/hud_elements/barHorizontal_shadow_mid.png');
        this.game.load.image('healthbarBgRight', 'assets/images/hud_elements/barHorizontal_shadow_right.png');
        this.game.load.image('healthbarGreenLeft', 'assets/images/hud_elements/barHorizontal_green_left.png');
        this.game.load.image('healthbarGreenMid', 'assets/images/hud_elements/barHorizontal_green_mid.png');
        this.game.load.image('healthbarGreenRight', 'assets/images/hud_elements/barHorizontal_green_right.png');
    };

    fn.prototype.displayHUD = function () {
        this.group = this.game.add.group();

        var x_pos = 5;
        var y_pos = 5;
        var MAX_HEALTH = 400;

        this.drawHealthBar(x_pos, y_pos, MAX_HEALTH, 'healthbarBg');
        this.drawHealthBar(x_pos, y_pos, MAX_HEALTH, 'healthbarGreen');
    };

    return fn;
})();

{'fraction_non_alphanumeric': 0.13541947666576748, 'fraction_numerical': 0.002697599136768276, 'mean_word_length': 3.2571756601607347, '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': '3054423', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1194, 'n_words': 164}