Making FoxPro Shake

The latest slightly ridiculous experiment in Galactic Gladiators is screen shake.

When the player’s ship is hit, the whole game moves around by a few pixels before returning to where it started.

It is actually quite a subtle effect, but once it is there you can definitely feel the difference. The collision suddenly has a bit more weight to it—especially when it is combined with the explosion sound and the controller rumbling.

As usual, the effect is quite simple once you know how it works. FoxPro remembers the original position of the game window, moves it randomly around that position for a few frames, and then puts it back exactly where it was.

The important bit is remembering the original position. Otherwise, each random movement could be based on the last one and the game would slowly wander off across the desktop.

I can now use different amounts of shake for different things. A shield hit can cause a small tremor, while the player’s ship exploding can shake everything much more violently.

The next idea is to combine it with the huge particle explosion from the old Defender arcade game.

That might be the next proper “wait… this is FoxPro?” moment.

For now, though, I have made Visual FoxPro shake—and that has amused me far more than it probably should.

Leave a comment