Skip to main content
edited tags
Link
DMGregory
  • 140.8k
  • 23
  • 257
  • 401
replaced question (asking how a specific game does something borders off-topic); grammar and punctuation; broke up text for readability; removed blacklisted tag (engine)
Source Link
Gnemlock
  • 5.3k
  • 5
  • 30
  • 60

How do peopleI program attacks and combos in games like Super Smash Brosa fighting game?

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?

How do people program attacks in games like Super Smash Bros?

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

How do I program attacks and combos in a fighting game?

I'm working on a game a bit like "Super Smash Bros.", using C++ and SFML. I can't figure out a good way to program attacks. 

First, I coded individual functions for each attack. The problem with this was that I needed three functions for each attack; 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. This ends up being almost the same code for all the other attacks, and was also very messy for programming combos. 

I then tried creating a class called Attack, and inherited classes like Punch and Kick. The problem with this was that I wasn't sure how to implement all of the methods in the Player class.

How do I program attacks and combos in a fighting game?

Tweeted twitter.com/StackGameDev/status/853926453783781377
Source Link
Merle
  • 77
  • 1
  • 7

How do people program attacks in games like Super Smash Bros?

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