How to Make a Combo System for Your Game
A combo system is a small state machine plus a timing window. Here is how to build one that reads every press, with frame data you can start from.

Key takeaways
- Split every attack into startup, active and recovery frames, and write the combo as a table of which attack follows which input.
- Buffer inputs for about 6 to 10 frames and open the combo window during recovery, so presses made a little early still count.
- Hit stop, cancels into dodge and a clear end to each chain are what make combos feel powerful without feeling sticky.
A combo system lets a sequence of inputs chain into a sequence of attacks: tap, tap, tap gives a three-hit string that ends in a finisher. Under the hood it is a state machine where each attack has a short window near its end during which the next input continues the chain instead of starting over, plus an input buffer that remembers presses made slightly too early. Get the window and buffer right and combos feel fluid; get them wrong and the game either drops inputs or plays attacks the player never meant.
Every attack has three phases
Fighting games describe attacks in frames (at 60 frames a second, one frame is about 16.7 ms), and the vocabulary is useful for any action game:
- Startup: the wind-up before the hit can land. Short startup (4 to 8 frames) feels snappy; long startup (15 to 30) reads as heavy and is a telegraph for enemies.
- Active: the frames the hitbox exists and can hit. Usually 2 to 6 frames for a slash, longer for a sweeping spin.
- Recovery: the follow-through when the player is committed and vulnerable. This is where the next combo input is accepted.
Starting frame data for a three-hit light combo: hit 1 at 5 startup, 3 active, 12 recovery; hit 2 at 6, 3, 14; finisher at 10, 5, 24 with more damage and knockback. The finisher's long recovery is the price of its power, and it is what stops players from mashing the same string forever.
Write the combo as a table
Do not hard-code combos as nested if-statements. Write them as data: each attack names its animation, frame data, damage, and a list of links saying which input leads to which next attack.
- `light1`: on light, go to `light2`; on heavy, go to `launcher`
- `light2`: on light, go to `light3`; on heavy, go to `spin`
- `light3`: no links (end of chain)
- `heavy1`: on heavy, go to `heavy2`
A table like this makes branching combos (light, light, heavy gives a different finisher than light, light, light) trivial to add and easy to describe to an agent. It also makes balance visible: you can read the total damage and total time of each string side by side. Pair it with the same data-driven approach used for stats in the RPG guide.
Input buffer and combo window: the numbers
Two timers do almost all the work, and they are the ones to expose as dials.
- Input buffer: when the player presses attack while the current attack cannot be interrupted yet, remember the press for 6 to 10 frames (100 to 170 ms). The moment the combo window opens, consume it. Without a buffer, players who press "on rhythm" but a hair early lose the combo and blame the game.
- Combo window: the span of recovery during which a buffered or fresh input continues the chain. Open it about halfway through recovery and close it 8 to 15 frames after recovery ends. After that, the chain resets to the first attack.
- Reset timer: if no attack follows within roughly 0.4 to 0.6 seconds, return to idle and reset the chain index. Showing a combo counter with this timer as a draining bar is a nice touch for character action games.
Fast, arcade-style games use a generous buffer and a long window (mashing works, the reward is spectacle). Precise, deliberate games use a short window and require a rhythm (the reward is mastery). Choose one feel on purpose; the defaults in between feel mushy.
Cancels, hit stop and movement
A combo that locks the player in place for a full second feels unresponsive, no matter how good it looks. Three tools fix that:
- 01Cancels. Allow dodge or jump to interrupt recovery (not startup) on most attacks. Players commit to an attack but can still escape a mistake. Make finishers non-cancelable for their first half to keep them risky.
- 02Hit stop. Freeze both attacker and target for 2 to 4 frames on light hits and 6 to 10 on finishers. It sells impact and gives players a beat to read the hit. The game feel guide covers hit stop and screen shake values in detail.
- 03Attack movement. Lunge forward 0.3 to 0.6 character widths on each hit, and stop the lunge on contact. Without it the player swings at air as the enemy is pushed out of range by knockback.
Bugs combo systems usually cause
- Double inputs. One tap fires two attacks because both the buffer and the live input were consumed. Clear the buffer the moment you use it.
- Ghost attacks. A buffered press from before a dodge fires after the dodge ends. Clear the buffer on any state change that is not an attack.
- Frame-rate dependent windows. Windows measured in rendered frames shrink on a 120 Hz screen and grow when the game stutters. Measure in time, or run combat on a fixed 60 Hz tick.
- Infinite combos. Knockback and hitstun that last longer than the next attack's startup let a light string loop forever. Give enemies a cap (for example, a guaranteed escape after 5 hits or 1.5 seconds of hitstun).
- Hitbox hits twice. An active hitbox that overlaps the same enemy for several frames deals damage each frame. Track which targets each swing already hit.
- Animation and logic disagree. The hitbox appears before the blade visibly reaches the enemy. Drive the hitbox from the same frame data the animation uses, and turn on hitbox drawing while tuning.
How combos combine with other mechanics
- Enemy behavior: enemies need telegraphed attacks and moments of vulnerability so combos have openings. The enemy AI guide covers telegraphs; combos are what the player does in those openings.
- Bosses: give bosses super armor during some attacks so a combo does damage without interrupting them, otherwise any boss can be stun-locked. See boss fight design.
- Score and style: a combo counter, a damage total that ticks up, and a bonus multiplier for variety (no repeated string) reward skill in arcade games.
- Movement abilities: jump cancels open air combos; a dash attack can start a chain. Each new move adds links to the table, not new code paths.
A combo system brief to paste
Add a melee combo system to my 2D brawler. Combat runs on a fixed 60 Hz tick. Store attacks in one data table with animation, startup, active and recovery frames, damage, knockback and links to the next attack per input. Light string: light1 (5/3/12, 10 dmg), light2 (6/3/14, 12 dmg), light3 finisher (10/5/24, 25 dmg, strong knockback). Light, light, heavy branches to a launcher. Buffer inputs for 8 frames; the combo window opens halfway through recovery and stays open 12 frames after; the chain resets after 0.5 s idle. Dodge cancels recovery except the first half of finishers. Hit stop 3 frames on light hits, 8 on finishers. Lunge 0.4 character widths per hit, stopping on contact, and soft-aim toward the nearest enemy within 45 degrees. Each swing hits each enemy once. Enemies escape hitstun after 5 hits. Show a combo counter. Expose buffer, window, hit stop and lunge as dials, and add a debug toggle that draws hitboxes.
Ask for the dials and you can tune them live in the engine panel described in the games template docs. Play the string a hundred times on a phone and on a keyboard: if you ever say "I pressed it", the buffer is too short; if an attack fires that you did not want, it is too long.
Frequently asked questions
What is an input buffer in a combo system?
An input buffer remembers a button press for a few frames (often 6 to 10 at 60 fps) when it arrives before the game can act on it, then uses it as soon as the next attack is allowed. It stops early presses from being dropped.
How long should a combo window be?
A good starting point is from halfway through an attack's recovery until about 8 to 15 frames after it ends. Lengthen it for arcade games where mashing should work, shorten it for games that reward rhythm.
How do I stop players from comboing enemies forever?
Cap hitstun, for example by letting an enemy escape after five hits or 1.5 seconds of being stunned, give finishers long recovery, and give bosses super armor during key attacks.
Do combos work on touch screens?
Yes, if the buffer is generous and attacks soft-aim toward nearby enemies. Touch input lacks the precision of a controller, so forgiving timing and auto-facing matter more on phones.

