๐ŸฅŠ Episode 5 ยท Improver ยท Controls

Press the Right Buttons
Episode 5: Commands

Commands are how a motion like a quarter-circle punch becomes a named thing your code can react to. This episode turns button presses into moves.

๐Ÿ‘ถ Ages 10+ โฑ๏ธ ~50 mins ๐ŸฅŠ MUGEN โœ“ Free workshop
๐ŸŽฎ [Command] ๐Ÿ•น๏ธ Motions โฑ๏ธ Buffers ๐Ÿง  React in code
โญ
0 XP
Level 1
๐Ÿ”ฅ0
Your Progress 0 / 4 steps
Build it in our MUGEN Studio too: set up a fighter, add sprites and poses, place hitboxes and export a real fighter folder in the browser, with no install. Open the MUGEN Mod Studio →
๐Ÿ”ฅ
Ember says: commands are just patterns in time. Forward, down, down-forward plus punch becomes one name, and your state code watches for that name.
1
๐ŸŽฎ
A Simple Command
Name a button
Active
๐ŸŽฏ
Goal for this step

Write a command for a single button.

  • 1Each command has a name, a command pattern and a time.
  • 2A single button is just its letter, like x.
  • 3The name is what your state code listens for.
[Command]
name = "x"
command = x
time = 1
โœ๏ธ
Fill in the Blanks
+15 XP
A command gives a to a button press.
๐Ÿง 
Knowledge Check
+15 XP
What does the name in a command do?
ALets your state code react to it
BSets the damage
CDraws the button
2
๐Ÿ•น๏ธ
Motions
Quarter circles and holds
Locked
๐ŸŽฏ
Goal for this step

Write a quarter-circle motion.

  • 1Directions use symbols: F forward, B back, D down, U up.
  • 2A quarter circle forward is down, down-forward, forward: D, DF, F, then a button.
  • 3Holding is written with a slash, like /$D for holding down.
[Command]
name = "QCF_x"
command = D, DF, F, x
time = 15
โœ๏ธ
Fill in the Blanks
+15 XP
A quarter circle forward is D, DF, then a button.
๐Ÿง 
Knowledge Check
+15 XP
What does the time value allow?
AHow long you have to do the motion
BThe damage
CThe sprite
3
โฑ๏ธ
Buffer and Feel
Forgiving inputs
Locked
๐ŸŽฏ
Goal for this step

Understand command buffering.

  • 1command.time is how long the engine waits for the full motion.
  • 2command.buffer.time lets a press just before you land still count.
  • 3Too tight is frustrating, too loose makes moves fire by accident.
โœ๏ธ
Fill in the Blanks
+15 XP
command..time makes inputs more forgiving.
๐Ÿง 
Knowledge Check
+15 XP
Why have a command buffer?
ASo a press just before landing still counts
BTo slow the game
CTo hide inputs
4
๐Ÿง 
React in Code
Connect commands to states
Locked
๐ŸŽฏ
Goal for this step

Trigger a state when a command fires.

  • 1In the state file you use a trigger like command = "QCF_x".
  • 2When it fires, a ChangeState controller switches the fighter to the punch state.
  • 3Command in .cmd, reaction in .cns. Two files, one move.
โœ๏ธ
Fill in the Blanks
+15 XP
A controller called switches the fighter to a new state.
๐Ÿง 
Knowledge Check
+15 XP
Which file reacts to a command?
AThe state file (.cns)
BThe sprite file
CThe sound file
๐ŸŽ‰โœจ๐Ÿ†๐ŸŽ‰
Moves on Command!
Button presses are now named commands you can code against. Next you write the states those commands trigger.
0
Total XP
1
Level
0
Best Streak
0%
Accuracy
Next: Episode 6: States and Constants โ†’