<commit_before>/*Original Game File - functions to help with displaying the game*/
angular.module("gameApp")
    .factory("graphicsEngineService", ["globalSettings", "coordinateSystem", function (globalSettings, coordinateSystem) {
        "use strict";
        return {
            initialise: function (canvasContext, graphicsFile) {
                this.spriteWidth = globalSettings.spriteSize;
                this.spriteHeight = globalSettings.spriteSize;
                this.canvas = canvasContext;
                this.spriteSheet = new Image();
                this.spriteSheet.src = graphicsFile;
            },

            convertGameXCoordinateToPixels: function (x) {
                return x * globalSettings.spriteSize;
            },

            convertGameYCoordinateToPixels: function (y) {
                return (y * globalSettings.spriteSize) + globalSettings.scoreBoardArea;
            },

            blankScreen: function () {
                var img = new Image;
                img.src = "http://imgur.com/QThBTyI";
                var pat = this.canvas.createPattern(img, "repeat");


                this.canvas.rect(0, 0, 450, 400);
                this.canvas.fillStyle = pat;
                this.canvas.fill();
                //this.canvas.fillStyle = globalSettings.gameBoardBackgroundColour;
                this.canvas.fillRect(0, 0, globalSettings.gameBoardWidth * this.spriteWidth, globalSettings.scoreBoardArea + (globalSettings.gameBoardHeight * this.spriteHeight));

            },

            drawText: function (coordSystem, x, y, text, colour, font) {
                if (coordSystem === coordinateSystem.world) {
                    x = this.convertGameXCoordinateToPixels(x);
                    y = this.convertGameYCoordinateToPixels(y);
                }

                /*
                var img = new Image;
                img.src = "../../images/bg.png";
                var pat = this.canvas.createPattern(img, "no-repeat");

<commit_msg>change scr<commit_after>/*Original Game File - functions to help with displaying the game*/
angular.module("gameApp")
    .factory("graphicsEngineService", ["globalSettings", "coordinateSystem", function (globalSettings, coordinateSystem) {
        "use strict";
        return {
            initialise: function (canvasContext, graphicsFile) {
                this.spriteWidth = globalSettings.spriteSize;
                this.spriteHeight = globalSettings.spriteSize;
                this.canvas = canvasContext;
                this.spriteSheet = new Image();
                this.spriteSheet.src = graphicsFile;
            },

            convertGameXCoordinateToPixels: function (x) {
                return x * globalSettings.spriteSize;
            },

            convertGameYCoordinateToPixels: function (y) {
                return (y * globalSettings.spriteSize) + globalSettings.scoreBoardArea;
            },

            blankScreen: function () {
                var img = new Image;
                img.src = "http://i.imgur.com/QThBTyI.png";
                var pat = this.canvas.createPattern(img, "repeat");


                this.canvas.rect(0, 0, 450, 400);
                this.canvas.fillStyle = pat;
                this.canvas.fill();
                //this.canvas.fillStyle = globalSettings.gameBoardBackgroundColour;
                this.canvas.fillRect(0, 0, globalSettings.gameBoardWidth * this.spriteWidth, globalSettings.scoreBoardArea + (globalSettings.gameBoardHeight * this.spriteHeight));

            },

            drawText: function (coordSystem, x, y, text, colour, font) {
                if (coordSystem === coordinateSystem.world) {
                    x = this.convertGameXCoordinateToPixels(x);
                    y = this.convertGameYCoordinateToPixels(y);
                }

                /*
                var img = new Image;
                img.src = "../../images/bg.png";
                var pat = this.canvas.createPattern(img, "no-repeat");


{'fraction_non_alphanumeric': 0.10302575643910977, 'fraction_numerical': 0.005001250312578144, 'mean_word_length': 1.8129395218002813, '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': '6119834', 'n_tokens_mistral': 1064, 'n_tokens_neox': 982, 'n_words': 203}