Seperating entities from their actions or behaviours
- by Jamie Dixon
Hi everyone,
I'm having a go at creating a very simple text based game and am wondering what the standard design patterns are when it comes to entities (characters, sentient scenery) and the actions those entities can perform.
As an example, I have entity that is a 'person' with various properties such as age, gender, height, etc. This 'person' can also perform some actions such as speaking, walking, jumping, flying, etc etc.
How would you seperate out the entity from the actions it can perform and what are some common design patterns that solve this kind of problem?