cassius Posted June 8, 2013 Posted June 8, 2013 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. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Road Kill Kenny Posted June 9, 2013 Posted June 9, 2013 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.. Quote 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!
AggrorJorn Posted June 9, 2013 Posted June 9, 2013 One of the leadwerks 3 tutorials covers classes in C++. The pathfinding tutorial also covers inheritance which you will find useful. Quote
cassius Posted June 9, 2013 Author Posted June 9, 2013 Thanks. I have watched the tutorial a couple of times. I will take a look at the actual code. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++
Recommended Posts
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.