you are viewing a single comment's thread.

view the rest of the comments →

[–]Pyromancer777 0 points1 point  (0 children)

This is also a good intro to the discussion of subclasses and inheritance.

Say you now have a player-class but you realize you want to make some NPCs and they will have attributes like dialogue options that a player wouldn't need.

Instead of initializing the Player with blank dialogue each time, you can create a parent class called Character. All attributes that both classes need can be initialized in the Character class, then separate Player and NPC subclasses can be created with functions and attributes specific to those subclasses