int GOAL = 2016; //ゴール int CUBE_NUM_0 = 100; //障害物の数の初期値 int CUBE_SIZE = 30; //障害物の大きさ int X = 600/2; //自機のx座標 int Y = 600-40; //自機のy座標 int VX = 3; //自機の速度x成分 int VY = 5; //自機の速度y成分 int a = 0; ArrayList cubes; //障害物 int numberOfCubes; //障害物の数 int distance; //進んだ距離 int reachedDistance; //進められた距離 int time; //経過時間 boolean alive; //ゲーム進行状態 boolean gameover; //ゲームオーバー状態 boolean gameclear; //ゲームクリア状態 //PFont font; //文字の書体 void setup() { size(600, 600, P3D); frameRate(60); smooth(); //font = loadFont("CenturyGothic.ttf"); setupGame(); } //ゲームの初期化 void setupGame() { a = 0; frameCount = 0; distance = 0; alive = true; gameover = false; gameclear = false; numberOfCubes = CUBE_NUM_0; cubes = new ArrayList(); for (int i = 0; i= GOAL*10) { gameclear = true; reachedDistance = GOAL*10; } } //障害物のクラス外部からの処理 void updateCubes() { //障害物の数を更新 if (cubes.size()