Help with Classes and Objects

mattkw80

Well-known member
Joined
Jan 3, 2008
Messages
49
Location
Ontario, Canada
Programming Experience
Beginner
I think I'm still a little confused about Classes and Objects.

I am creating a small game, to teach myself programming. It's kind of like a Pokemon card game, with different characters, monsters etc.

I want to use a HERO Class to store all the info on the players and a MONSTER class to store all info on Monsters. But... I am having all kinds of trouble with the idea of allowing these objects be present no matter what form or module I am dealing with.

So if I have an Object named "Superman" and it's got these kinds of properties :

superman.name = "Superman"
superman.health ="100"
superman.speed ="100"
superman.inventory1 ="backpack"

and a monster might look like this

goblin.name = "goblin"
goblin.health ="22"
goblin.speed ="50"
goblin.inventory1 ="axe"


I guess my question is.... how can I create the SUPERMAN object, from the HERO CLASS so that I can "publicly" use it no matter what FORM or MODULE I am in?

Right now, it seems I can only Create and Use the Object in 1 place at a time.

I'm confused at to how this is supposed to work, please help!!
 
Top Bottom