As you may have seen from my previous threads, I am slowly teaching myself Python 3 by writing various RPG-related scripts, primarily for Traveller (or the Cepheus Engine).
I am intermittently working on my sector generator, but now am trying my hand at a character generator. This is a very useful project, as it allows me to experiment with Object-Oriented Programming. This is my FIRST EVER EXPERIENCE with OOP, and so far is going very well; I have already learned about Inheritance.
I also learned quite a lot about Dictionaries from dealing with the skill list.
The main concept is this is a super-class called Career which has all the chargen methods, then a specific career class which inherits from it and sets the career values (enlistment, survival, skill lists, etc), then the character himself who is also a class and inherits from the specific career class.
All classes except for the character itself will be in a "library" py file, with the program's "mechanics" (the generation process itself, saving to file, etc) being in the "main" py file.
Very enjoyable and educative so far!
I am intermittently working on my sector generator, but now am trying my hand at a character generator. This is a very useful project, as it allows me to experiment with Object-Oriented Programming. This is my FIRST EVER EXPERIENCE with OOP, and so far is going very well; I have already learned about Inheritance.
I also learned quite a lot about Dictionaries from dealing with the skill list.
The main concept is this is a super-class called Career which has all the chargen methods, then a specific career class which inherits from it and sets the career values (enlistment, survival, skill lists, etc), then the character himself who is also a class and inherits from the specific career class.
All classes except for the character itself will be in a "library" py file, with the program's "mechanics" (the generation process itself, saving to file, etc) being in the "main" py file.
Very enjoyable and educative so far!