I'm having a go at creating a very simple text based game and I'm wondering how I can design the entities (characters, sentient scenery) with regards to the actions those entities can perform.
As an example, I have an 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 separate out the entity from the actions it can perform?
Answer
The common answer you'll get is "with components". There are lots of questions with that phrase in them that you can search through.
In particular, here's a good article that has been linked to several times that's worth a read: http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/
No comments:
Post a Comment