How did I design the Hit-feel without audio module
For the MATLAB One-Button Minihack, I built an ink-wash samurai duel game called ONE BLADE. The contest environment has no audio, runs at around 30 fps, and draws everything inside a fixed axes window. Without a clang or impact sound, two blades meeting on screen can look flat, and it becomes hard for the player to tell right away whether a block or deflect actually landed.
Here are the seven visual techniques I used in the game.
1. Hit-stop
Freeze the entire world for a few dozen milliseconds on impact. When the image suddenly holds for a brief moment, the eye naturally reads that pause as the resistance of two objects colliding.
At the top of update, I check the remaining hit-stop timer and return early if it is above zero, leaving the game clock untouched. If the player presses the button during the freeze, that input is saved in a buffer flag and consumed as soon as the pause ends so no taps are dropped. The screen-shake offset runs before the early return, so the camera still shudders while the scene is frozen and the pause does not look like a lag spike.
2. Screen shake
After a hit, I add a random offset to the camera that decays linearly to zero as the effect nears its end time.
In MATLAB, there is no need to loop through and shift every object on screen. Moving the axes XLim and YLim during rendering shakes the whole scene at once.
3. Ink inversion frames
Fighting games and animation often insert two or three black-and-white inverted frames on a heavy hit, known as impact frames. Since my game already uses black silhouettes on a light paper background, this fits naturally. On impact, I turn on a full-screen black rectangle behind the fighters and flip the characters, slash arcs, and text to white for two or three frames before switching back.
At 30 fps, two or three frames is under a tenth of a second. It goes by too fast to study, but the sudden contrast flip is enough to signal a heavy blow.
4. Screen flash
A full-screen patch sits on top of every other layer, normally fully transparent. On a trigger, its alpha jumps up and fades out quickly. A white flash marks blocks and round transitions, while a red flash marks taking damage. That way the player can read the outcome from the edge of their vision without looking away to check the health indicators.
5. Sparks
At 30 fps, drawing sparks as tiny dots makes it hard to sense how fast they are moving. I store each spark's origin and initial velocity as complex numbers, compute its parabolic path under a gravity of 450, and connect its current position to its position 0.03 seconds earlier. Separating each short streak with NaN lets MATLAB draw all of them in a single line object.
The sparks use three colors to tell exchanges apart. Ink black is for regular blocks and strikes, orange is for deflects and parries, and crimson is for taking a hit or landing the finisher.
6. Impact pose snapping
If character movement relies purely on smooth interpolation, both swings and hits tend to look soft. I keep a table of preset impact poses for deflecting, recoiling, getting cut, and swinging. On the frame of contact, the character snaps straight to the impact pose with no transition, then eases back toward the normal stance like a spring over the next several frames. The sense of force comes mainly from that sudden jump.
7. Camera zoom and slow motion
When the enemy's posture breaks or the finishing cut lands, the camera zooms in by 20% and game time slows down to one-fifth speed, with both easing back to normal over about half a second.
In code, the zoom factor s.zo (which returns from 0.8 to 1.0) also drives the time scale via dt * (4*s.zo - 3), keeping the camera pullback and speed recovery locked together. Hit-stop still counts down in real time rather than scaled time, otherwise a short freeze would get stretched out far too long.