First of all, Hello! Im new to Panda3D, and loving it so far. Gotta love that its Python! (not that I’m a fundi in that regard, but I’ve just started learning it too, and its great)
I am starting to work on a 8-direction run-and-gun game in the spirit of The Chaos Engine. I want to use 8 directions because it is the best control system for 2 players on one PC (and I love the retro feel)
Im trying to decide how to split up all of my code. I think it makes sense to have every character in the game in its own class, all with pretty much the same set of functions, so that the AI or player could “easily” be made to control any of them.
As an extremely basic example structure, does the following seem logical?
Class Player_Character(controller_type) Move(direction) Shoot() Mod_Health(int) #add or subtract health Mod_Lives(int) #add or subtract lives Collide() #do we need a collide method? Class Enemy_Character(controller_type) Move(direction) Shoot() Mod_Health(int) #add or subtract health Mod_Lives(int) #add or subtract lives Collide() #do we need a collide method? Class Controller_Player() #I think this class will be called inside the character class, and will presumably start up a task that transforms key presses into instructions every frame Class Controller_AI() #I think this class will be called inside the character class if it is to be a computer controlled character, and will presumably start up a task, that gives the character instructions every frame Class Bullet() #not sure why I need this just yet, but Im sure I will
I want my code to be as modular as possible, so that if I later develop a better AI or control system or anything along those lines, that I can just swap it out.
I hope this made sense, I find things always become clearer once I have bounced the ideas off people.