//主人公の行動を決定するコマンド枠の設定 void status1() { //コマンド枠 fill(255); rect(20, 400, 150, 180); //コマンド詳細 fill(0); textSize(25); text("こうげき", 50, 440); text("まほう", 50, 480); text("???", 50, 520); text("にげる", 50, 560); //魔法が選択された場合 if (battle == 1) { //魔法選択用のコマンド枠 fill(255); rect(200, 180, 250, 400); //スキルを習得している場合は名前を表示。それ以外は???を表示。 fill(0); textSize(25); for (int i = 0; i < 10 ; i++) { if (player.skill[i]) text(magic[i].name, 230, 210+40*i); else text("???", 230, 210+40*i); } } } //HP、MPの表示 void status2(float h, float m_h, float m, float m_m) { //HP fill(255); rect(200, 400, 380, 20); fill(#ff6666); rect(200, 400, int((h/m_h)*380), 20); //MP fill(255); rect(200, 430, 380, 20); fill(#6666ff); rect(200, 430, int((m/m_m)*380), 20); //数字で表示 fill(0); textSize(12); text(int(h), 550, 415); text(int(m), 550, 445); } //コマンドログの作成 void status3() { //コマンドログ fill(255); rect(200, 460, 380, 120); fill(0); textSize(20); for (int ty = 0;ty<5;ty++) { fill(log_color[ty]); text(log[ty], 210, 570-ty*22); } } //バトルログを上に流していく関数 //バトルログに書き込む際は書き込む直前にこの関数を実行する void log_off() { for (int c = 4;c>0;c--) { log_color[c] = log_color[c-1]; log[c] = log[c-1]; } log_color[0] = 0; }