前回は対象を絞るといいと言われましたので、にループから始めてみようと、ネットで調べた物を使ってみましたが、
上手く行きませんでした。以下のコードは以前と同じくトリアコンタンさんから頂いたスクリプトを改造した物で、
mawaruという変数で鼠を回し続ける物です。どうか解決策を教えて下さいませ。宜しくお願い致します。
コード: 全て選択
//
/*
@PluginDesc テスト用プラグイン
@Author Furoshiki
@help
*/
/*
(function() {//トリアコンタン様提供
ImageManager.loadBitmap = function(folder, filename, hue, smooth) {
if (filename) {
var path = folder + encodeURIComponent(filename) + '.png';
var bitmap = this.loadNormalBitmap(path, hue || 0);
bitmap.smooth = smooth;
return bitmap;
} else {
return this.loadEmptyBitmap();
}
};
};
})();
*/
(function() {//トリアコンタン様提供
'use strict';
var _Spriteset_Map_createLowerLayer = Spriteset_Map.prototype.createLowerLayer;
var mawaru = 0;
Spriteset_Map.prototype.createLowerLayer = function() {
// createLowerLayerの元の処理を呼び出します。
_Spriteset_Map_createLowerLayer.apply(this, arguments);
// 画像を格納する箱を作成します。
this._testSprite = new Sprite();
this._testSprite2 = new Sprite();
this._testSprite3 = new Sprite();
// 箱に実際の画像をロードします。(ピクチャフォルダのファイル名を指定。拡張子不要)
this._testSprite.bitmap = ImageManager.loadPicture('Bat');
//蝙蝠を斜め45度へ傾ける。
this._testSprite.rotation = 45 * Math.PI / 180;
this._testSprite.x = 100;
this._testSprite.y = 200;
this._testSprite.scale.x = 1.5;
this._testSprite.scale.y = 0.5;
// 箱を画面に追加します。
this.addChild(this._testSprite);
// 二つ目の画像を扱う
this._testSprite2.bitmap = ImageManager.loadPicture('Actor1_3');
this._testSprite2.rotation = -45 * Math.PI / 180;
this._testSprite2.x = 500;
this._testSprite2.y = 150;
this._testSprite2.scale.x = -1;
this._testSprite2.scale.y = 1;
// 箱を画面に追加します。
this.addChild(this._testSprite2);
// 三つ目の画像を扱う
this._testSprite3.bitmap = ImageManager.loadPicture('Rat');
this._testSprite3.rotation = 450 * Math.PI / 180;
this._testSprite3.x = 400;
this._testSprite3.y = 150;
this._testSprite3.scale.x = -1;
this._testSprite3.scale.y = 1;
this._testSprite3.anchor.x = -0.5;//中心点を画像の半分*半分にしたい。
this._testSprite3.anchor.y = 0.5;
this._testSprite3.alpha = 0.5;
// 箱を画面に追加します。
this.addChild(this._testSprite3);
for(mawaru = 0;mawaru > 100;mawaru++){
this._testSprite3.rotation += 10 * Math.PI / 180;
this.addChild(this._testSprite3);
};
};
})();