Hey all,
The fog is starting to lift in regard to OOP for me, but its still foggy. What I’m trying to figure out now is how do I go from creating an object to making it functional?
For example, say I want to create a generic football player. I’d use a code like this:
function Player(name, position) {
this.name = name;
this.position = position;
//objects conatined in Player will hold
//their own properties
this.experience = {};
this.running = {};
this.catching = {};
this.toughness = {};
this.defense = {};
}
My sample player name array:
name = new Array(“Jones”, “Smith”, “Hakim”, “Jackson”, “Manning”);
How would I go from this to randomly creating and generating players?
I’ve been unable to get my code to work. Any suggestions? I know I’m just not understanding something. Thanks.