Polymorphism using Interfaces: Damage Method
Objective: exploit the polymorphism to implement a modular damage system that can be applied to several kinds of game objects (or classes)
As I introduced before, our player can now perform attacks and has a cool hitbox around the sword that could detect collisions (trigger) with anything else.
The player can attack and hit an enemy but also a chest containing some loot and who knows how many other different objects. We can now take the decision to be bad-ass programmers or just bad programmers: would you overload the Damage…