Excel VBA macro to move shape right and left with a smooth motion when holding down keys

Job ID: 31531169

Budget: €30 – €250 EUR

I'm trying to code a platform game in Excel where the user can move a figure right and left while holding down the keys, like in Super Mario Bros and other classics. I manage to get a simple shape to move back and forth but the animation doesn't run smooth enough. The movement of the shape is uneven. Depending of what technique I try, the shape either start moving once I press the key down but then pauses for a short while and then resuming (just like any typing on the keyboard does when holding a key down), or the shape is "stuttering" during movement in the running loop when I hold the key down.

I have experimented with different techniques to catch the key event (worksheet_onchange, windows system lib) and one issue to handle is the long press of the keys. I want the shape to start moving the instant I press down right or left and it should continue to move while holding the key down.

Preferably I want to use left and right arrow for movement but this is not crucial.

Do deliver if you can solve this, is a simple excel workbook with:

* Standard vba code - references to windows libs like "kernel32" are ok, but not any custom coded activex components or similar
* A sheet with a simple Excel shape as figure
* A macro with a loop that can be started and when running, moves the shape to left and right when pressing and holding down (important!) arrow keys (or others) in a smooth action

And it should work in current version of Office 365 (I have 2002 build 12527.20442).
Related categories: Excel Excel VBA Excel Macros