I want to store some information about energy sources that I am harvesting. Ideally I would use mySource.memory.taken
but Source does not have a memory property.
I could implement something like this:
Source.prototype.memory = function() {
return Memory.sources[this.id];
}
But can I implement the same thing as a property like other game objects rather than a method? Or is there a better approach than this?