Jump to content

learning classes


cassius
 Share

Recommended Posts

I wrote my le2 game in plainc but now with le3 I am enjoying using the different syntax and finding it farly easy.

 

In my le2 game I used a struct called actors which had all my characters as members, but now I want to try and use a class instead so I need to figure it out.

 

Is it better to have a single actor class or a seperate class for each character?Thanks.

amd quad core 4 ghz / geforce 660 ti 2gb / win 10

Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++

Link to comment
Share on other sites

Each character should be its own instance of your character class.

 

More specifically code a base class for generic characters that has all the functionality that every character will 100% need. Then for specific character functionality derive a new character class by inheriting from the base class.

 

You should store the handle to each character in some kind of list. Personally I usually make a level manager class which is responsible for holding this list and updating each every frame...

 

I can elaborate if you wish..

 

 

STS - Scarlet Thread Studios

AKA: Engineer Ken

 

Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...