//コマンドセレクト用の矢印の関数 //コマンドセレクトその1 //たたかう、まほう、にげる を決めるときに出る矢印 class Command1 { int position=0; int x, y, max; Command1() { max = 3; } void move(int a) { position = position + a; if (position< 0) position = max; if (position > max) position = 0; } void display() { x = 30; fill(0); y = 423 + 40 * position; triangle(x, y, x, y+16, x+12, y+8); } } //コマンドセレクトその2 //魔法は何を使う?とかを決めるときに出る矢印。 class Command2 extends Command1 { Command2() { max = 9; } void display() { x = 210; fill(0); y = 195 + 40 * position; triangle(x, y, x, y+16, x+12, y+8); } }