<commit_before>/*
 *  PlanetBuster3
 *  2014/09/04
 *  @auther minimo  
 *  This Program is MIT license.
 */
(function() {

//namespace PlanetBuster3
pb3 = {
    core: null,
};

pb3.PlanetBuster3 = tm.createClass({
    superClass: tm.app.CanvasApp,

    score: 0,
    highScore: 0,       //ハイスコア
    highScoreStage: 0,  //ハイスコア時ステージ
    difficulty: 0,      //難易度(0-3)

    highScore: 0,
    score: 0,
    extendNumber: 0,
    extendScore: null,

    //演奏中ＢＧＭ
    bgm: null,

    //ＢＧＭ演奏フラグ
    bgmIsPlay: false,

    //ＢＧＭ音量
    volumeBGM: 1.0,

    //ＳＥ音量
    volumeSE: 1.0,

    init: function(id) {
        this.superInit(id);

        //エクステンドスコア配列
        this.extendScore = [];
        this.extendScore.push(100000);
        this.extendScore.push(200000);
        this.extendScore.push(300000);

        pb3.core = this;
        this.resize(SC_W, SC_H).fitWindow();
        this.fps = 60;
        this.background = "rgba(0, 0, 0, 1.0)";
        this.keyboard = tm.input.Keyboard(window);

        //アセット読み込みシーン
        var loadingScene = tm.ui.LoadingScene({
            assets: pb3.assets,
            width: SC_W,
            height: SC_H,
            bgColor: "black",
            nextScene: function() {
                this._onLoadAssets();
                return pb3.WaitScene();
            }.bind(this),
        });

        this.replaceScene(loadingScene);
    },

    _onLoadAssets: function() {
        [
            "tex1",
            "tex2",
            "boss1",
        ].forEach(function(name) {
            //瀕死用ビットマップ作成
            var tex = tm.asset.AssetManager.get(name);
            var canvas = tm.graphics.Canvas();
            canvas.resize(tex.width, tex.height);
            canvas.drawTexture(tex, 0, 0);

            var bm = canvas.getBitmap();
            bm.filter({
                calc: function(pixel, index, x, y, bitmap) {
                    bitmap.setPixelIndex(index, pixel[0], 0, 0);
                }
            });
            var cv = tm.graphics.Canvas();
            cv.resize(tex.width, tex.height);
            cv.drawBitmap(bm, 0, 0);
            tm.asset.AssetManager.set(name + "Red", cv);

            //ダメージ用ビットマップ作成
            var tex = tm.asset.AssetManager.get(name);
            var canvas = tm.graphics.Canvas();
            canvas.resize(tex.width, tex.height);
            canvas.drawTexture(tex, 0, 0);

            var bm = canvas.getBitmap();
            bm.filter({
                calc: function(pixel, index, x, y, bitmap) {
                    var r = (pixel[0]==0?0:128);
                    var g = (pixel[1]==0?0:128);
                    var b = (pixel[2]==0?0:128);
//                    bitmap.setPixelIndex(index, r, g, b);
                    bitmap.setPixelIndex(index, 0, 0, pixel[2]);
                }
            });
            var cv = tm.graphics.Canvas();
            cv.resize(tex.width, tex.height);
            cv.drawBitmap(bm, 0, 0);
            tm.asset.AssetManager.set(name + "White", cv);
        });
    },

    exitApp: function() {
        this.stop();
        tm.social.Nineleap.postRanking(this.highScore, "");
    },

    playBGM: function(asset, loop) {
        if (this.bgm) {
            if (this.bgmIsPlay) {<commit_msg>update enemy damage texture<commit_after>/*
 *  PlanetBuster3
 *  2014/09/04
 *  @auther minimo  
 *  This Program is MIT license.
 */
(function() {

//namespace PlanetBuster3
pb3 = {
    core: null,
};

pb3.PlanetBuster3 = tm.createClass({
    superClass: tm.app.CanvasApp,

    score: 0,
    highScore: 0,       //ハイスコア
    highScoreStage: 0,  //ハイスコア時ステージ
    difficulty: 0,      //難易度(0-3)

    highScore: 0,
    score: 0,
    extendNumber: 0,
    extendScore: null,

    //演奏中ＢＧＭ
    bgm: null,

    //ＢＧＭ演奏フラグ
    bgmIsPlay: false,

    //ＢＧＭ音量
    volumeBGM: 1.0,

    //ＳＥ音量
    volumeSE: 1.0,

    init: function(id) {
        this.superInit(id);

        //エクステンドスコア配列
        this.extendScore = [];
        this.extendScore.push(100000);
        this.extendScore.push(200000);
        this.extendScore.push(300000);

        pb3.core = this;
        this.resize(SC_W, SC_H).fitWindow();
        this.fps = 60;
        this.background = "rgba(0, 0, 0, 1.0)";
        this.keyboard = tm.input.Keyboard(window);

        //アセット読み込みシーン
        var loadingScene = tm.ui.LoadingScene({
            assets: pb3.assets,
            width: SC_W,
            height: SC_H,
            bgColor: "black",
            nextScene: function() {
                this._onLoadAssets();
                return pb3.WaitScene();
            }.bind(this),
        });

        this.replaceScene(loadingScene);
    },

    _onLoadAssets: function() {
        [
            "tex1",
            "tex2",
            "boss1",
        ].forEach(function(name) {
            var tex = tm.asset.AssetManager.get(name);

            //瀕死用ビットマップ作成
            var canvas = tm.graphics.Canvas();
            canvas.resize(tex.width, tex.height);
            canvas.drawTexture(tex, 0, 0);

            var bm = canvas.getBitmap();
            bm.filter({
                calc: function(pixel, index, x, y, bitmap) {
                    bitmap.setPixelIndex(index, pixel[0], 0, 0);
                }
            });
            var cv = tm.graphics.Canvas();
            cv.resize(tex.width, tex.height);
            cv.drawBitmap(bm, 0, 0);
            tm.asset.AssetManager.set(name + "Red", cv);

            //ダメージ用ビットマップ作成
            var canvas = tm.graphics.Canvas();
            canvas.resize(tex.width, tex.height);
            canvas.drawTexture(tex, 0, 0);

            var bm = canvas.getBitmap();
            bm.filter({
                calc: function(pixel, index, x, y, bitmap) {
                    var r = (pixel[0]==0?0:128);
                    var g = (pixel[1]==0?0:128);
                    var b = (pixel[2]==0?0:128);
                    bitmap.setPixelIndex(index, r, g, b);
                }
            });
            var cv = tm.graphics.Canvas();
            cv.resize(tex.width, tex.height);
            cv.drawBitmap(bm, 0, 0);
            tm.asset.AssetManager.set(name + "White", cv);

            //ダメージ用ビットマップ作成２
            var canvas = tm.graphics.Canvas();
            canvas.resize(tex.width, tex.height);
            canvas.drawTexture(tex, 0, 0);

            var bm = canvas.getBitmap();
            bm.filter({
                calc: function(pixel, index, x, y, bitmap) {
                    bitmap.setPixelIndex(index, 0, 0, pixel[2]);
                }
            });
            var cv = tm.graphics.Canvas();
            cv.resize(tex.width, tex.height);
            cv.drawBitmap(bm, 0, 0);
            tm.asset.AssetManager.set(name + "Blue", cv);
        });
    },

    exitApp: function() {
        this.stop();
        tm.social.Nineleap.postRanking(this.highScore, "");
    },

    playBGM: function(asset, loop) {
        if (this.bgm) {
            if (this.bgmIsPlay) {
{'fraction_non_alphanumeric': 0.13972602739726028, 'fraction_numerical': 0.02638788752703677, 'mean_word_length': 1.4860215053763441, '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': '5750156', 'n_tokens_mistral': 2502, 'n_tokens_neox': 2344, 'n_words': 420}