Hello Zharma, what about using TakeDamage instead of overloading the classes with an interface? , I have made the changes you suggest. Now the question is what is the best way to add collisiopn detection, with a sensor (non-physic collider) and configure a channel, or do the sphere test each n milliseconds during the blast for each part in the 4 directions using the amount related directly with the power of the bomb?
Changes:
removed the tick from the bomb, created player controller to get the input and control the character (pawn) and a blastdamage class to apply on takedamage, so the control chain is :
- GameMode creates the bomberman player controller and the character
- player interaction: input is read from player controller that calls the character functions to move, fire, etc
- Character creates a bomb and add it to a list ,set also the owner in the bomb
- The bomb contains only timers:
- for the fuze to explode ,once
- size animation together repeated each 0.015sec
- the explosion creates the blast particles, it then check for collision(colliders or sphere test to detect a hit)
- the bomb tries to use the character to send him the message of what it hits with the blast if there is no owner, the bomb can call the takeDamage that’s implemented in all actors
In the next step, the character should use the gamemode to know what state is the game in, check what to do with the hit, …and use TakeDamage function for the list of actors being affected by the bomb, this formula works good, for blocks, characters, other bombs, etc, what do you think?