ゲームにロードする前に敵をオブジェクトとして保存したいゲームを作っています。
var that = this;
this.enemies = {
that.redCar : document.getElementById('red'),
that.sportsCar : document.getElementById('sport')
}
しかし、これにより構文エラーが発生します。that.redCar : document.getElementById('red')
オブジェクトの内側はオブジェクトの外側に等しいと思いましたthat.redCar = document.getElementById('red')
。
どこが間違っていますか?