Hello,
I am trying to add simple combat to a top-down 2d game I am making, but I am unsure about how to implement such a system. My current attempts leave me with the impression that I am doing something wrong.
My current approach it to create a controller script, and an abstract Ability class, the controller then has references to classes the extend ability. When a key is pressed, the script then calls a use() function overridden in the subclass.
However, I get an error message whenever I try to use ‘new’ to instantiate the subclass of Ability, which I don’t really understand.
I’m guessing this is a bad approach, so my question is, what is a good approach to this?
(The game is going to be similar to Binding of Issac, but with melee weapons, so I’m trying to create a melee weapon right now)