実はこれ、JavaScriptでもできる。
function Fish(speed, direction, x, y) { this.speed = speed; ... } var fish = new Fish(speed = 10, direction = 1, x = 10, y = 100);
^^
実はこれ、JavaScriptでもできる。
function Fish(speed, direction, x, y) { this.speed = speed; ... } var fish = new Fish(speed = 10, direction = 1, x = 10, y = 100);
^^