I'm working on a game a bit like Super Smash Bros"Super Smash Bros.", using C++ and SFML (probably irrelevant) , and. I can't figure out a good way of programmingto program attacks.
First, I coded individual functions for each attack. The problem with this was that I needed around three functions for each attack (dealing knockbackattack; one for dealing knock-back to other players, one for setting variables for the actual punch and one for checking for unique types of collision) which. This ends up being almost the same code asfor all the other attacks. This, and was also very messy for programming combos. Then,
I then tried creating a class called 'Attack'Attack, and inherited classes like 'Punch'Punch and 'Kick'Kick. The problem with this was that I wasn't sure how to implement all of the functionsmethods in the 'Player'Player class. What's a good way to
How do I program attacks and combos in a fighting game?