Jumping attack from under the platform, then knock the enemy just like Mario Bross 1983

So, I want to create a game where, when a player hits a platform from the bottom, it’ll knock the enemy above the platform. The best example I can give you guys is Mario Bross 1983 as shown in the picture, I’ve been trying to google for hours but didn’t find any tutorial or example to create such a mechanic. I wonder if any of you guys know what this is called? and I really appreciate you for your answer. Thank you!

so i think the best solution would be:

have square collision boxes around spirtes - and build your platform using these small blocks.

put a small colider ontop of your player and detect if that colider hits the block.
if so, animate the box moving upwards and back down / or via code
and check if enemy is over the block moving. if so add force to it?

there are other ways