So, I have a player class with basic actions. During the gameplay he unlocks new abilities. I don’t know how to store new actions within the player class. To be precise – I know how, but my method is too messy and i want to clean up code. Also, I want to add to the enemies some of those abilities. In other words, every game entity(expect walls, perhaps :D) should have a collection to which i can add methods that extend entity functionality. How do i make this? Sorry, if my question is too abstact
Share
Create an action dictionary:
Then you can populate it like this:
And use like this:
Just put the population code somewhere on the outskirts (separate
voidmethod, maybe player’s constructor), or it will interfere with your edit and continue ability, because it’s a lambda expression.