2 // グローバル名前空間にmainManager,
3 // ローカルに stageがすでに存在する状況下で呼ばれる。
8 stage.runStage = function(){
9 //元々定義されていた、疑似スーパークラス(prototype)の関数を呼び出す。
10 this.super_runStage();
11 for(i = 0; i < 2; i++){
12 aCircle = new StageObject(this);
13 aCircle.origin.x = 16 + 16 * i;
14 aCircle.origin.y = 16 + 16 * i;
15 aCircle.frame.origin.x = - (8 + i);
16 aCircle.frame.origin.y = - (8 + i);
17 aCircle.frame.size.x = 2 * (8 + i);
18 aCircle.frame.size.y = 2 * (8 + i);
20 this.addStageObject(aCircle);
23 stage.timerTick = function(){
24 this.super_timerTick();
25 if(this.manager.keyState.upArrow){
27 for(i = 0; i < this.stageObjectList.length; i++){
28 this.stageObjectList[i].movingSpeed.y -= this.moveForce;
32 if(this.manager.keyState.downArrow){
34 for(i = 0; i < this.stageObjectList.length; i++){
35 this.stageObjectList[i].movingSpeed.y += this.moveForce;
38 if(this.manager.keyState.leftArrow){
40 for(i = 0; i < this.stageObjectList.length; i++){
41 this.stageObjectList[i].movingSpeed.x -= this.moveForce;
44 if(this.manager.keyState.rightArrow){
46 for(i = 0; i < this.stageObjectList.length; i++){
47 this.stageObjectList[i].movingSpeed.x += this.moveForce;