Adding smooth movement to a one-button MATLAB game

I made a little game called TIDE//SHIFT for the One-Button Game Mini Hack using MATLAB and Codex.
One thing I experimented with was adding momentum to the movement. Instead of instantly changing direction when you press Space, the character drifts a little before turning.
I used a simple damping formula:
target = 110 * polarity;
blend = 1 - exp(-4.4 * dt);
v = v + (target - v) * blend;
A small change, but it makes the game much more fun to control.
If you're making a one-button game, try experimenting with momentum. It really changes how the game feels.

Tags

No tags entered yet.