I'm making a game where I want to store the enemies as an object before loading them into the game.
var that = this;
this.enemies = {
that.redCar : document.getElementById('red'),
that.sportsCar : document.getElementById('sport')
}
But this gives me a syntax error. I thought that.redCar : document.getElementById('red') in an object would be equal to that.redCar = document.getElementById('red') outside of one.
Where am I going wrong?