回答編集履歴
1
typoのため
answer
CHANGED
@@ -14,8 +14,8 @@
|
|
14
14
|
// x だけ右にうごく関数(メソッド)
|
15
15
|
moveRight( x ){
|
16
16
|
// 左右ともにX動く
|
17
|
-
this.left =
|
17
|
+
this.left += x;
|
18
|
-
this.right =
|
18
|
+
this.right += x;
|
19
19
|
// センターは再計算
|
20
20
|
this.center_x = ( this.left + this.right ) /2;
|
21
21
|
}
|