切換
舊版
前往
大廳
主題

RM MV學習筆記(30) Battle畫面構成筆記

路漫行 | 2018-05-07 09:35:33 | 巴幣 0 | 人氣 425


啟動、分派視窗、計時器:Scene_Battle
    this.createLogWindow();//戰鬥LOG文字視窗
    this.createStatusWindow();//狀態視窗(畫面右下方顯示角色狀態
    this.createPartyCommandWindow();//(命令:戰鬥、逃走)
    this.createActorCommandWindow();//(命令:攻擊、魔法、道具、防禦)
    this.createHelpWindow();//(HELP視窗
    this.createSkillWindow();//技能視窗
    this.createItemWindow();//道具視窗
    this.createActorWindow();//角色視窗
    this.createEnemyWindow();//敵人視窗
    this.createMessageWindow();//說話的文字視窗
    this.createScrollTextWindow();//???



描繪整體畫面:Spriteset_Battle

this.createBackground();
this.createBattleField();
this.createBattleback();
this.createEnemies();  ---> new Sprite_Enemy()
this.createActors();   ---> new Sprite_Actor()

前三個是組合背景後面兩個是怪物跟玩家,因為先建立怪物,所以玩家一定會蓋掉怪物。這裡可以更改顯示順序。

Sprite_Actor
    this.createShadowSprite(); //描繪陰影
    this.createWeaponSprite(); //描繪武器
    this.createMainSprite(); //描繪動作
    this.createStateSprite(); //描繪狀態顯示

//設定角色動作
Sprite_Actor.MOTIONS

//設定玩家起始位置
Sprite_Actor.prototype.setActorHome = function(index) {
    this.setHome(600 + index * 32, 280 + index * 48);
};

//設定動作圖檔的分切位置
//修改這裡就可以改變預設的連環三圖大小、格數跟位置
Sprite_Actor.prototype.updateFrame = function() {
    Sprite_Battler.prototype.updateFrame.call(this);
    var bitmap = this._mainSprite.bitmap;
    if (bitmap) {
        var motionIndex = this._motion ? this._motion.index : 0;
        var pattern = this._pattern < 3 ? this._pattern : 1;
        var cw = bitmap.width / 9;
        var ch = bitmap.height / 6;
        var cx = Math.floor(motionIndex / 6) * 3 + pattern;
        var cy = motionIndex % 6;
        this._mainSprite.setFrame(cx * cw, cy * ch, cw, ch);
    }
};





本次目標...

Sprite_Actor.prototype.setBattler = function(battler) {
    Sprite_Battler.prototype.setBattler.call(this, battler);
    var changed = (battler !== this._actor);
    if (changed) {
        this._actor = battler;
        if (battler) {
            this.setActorHome(battler.index());
        }
        this.startEntryMotion();
        this._stateSprite.setup(battler);
    }
};


上星期一直在找Sprite_BattlersetBattler到底是誰幫他set的...
new Sprite_Battler當關鍵字什麼都找不到
原來是這樣來的...

Sprite_Actor.prototype = Object.create(Sprite_Battler.prototype);

Sprite_Battler只是一個讓Actor跟Enemy呼叫用的底層所以不會直接new他



最後傷害演出
Sprite_Battler.prototype.setupDamagePopup() ---> new Sprite_Damage()



差不多就這些吧...

送禮物贊助創作者 !
0
留言

創作回應

更多創作