Ah yes, more interesting levels would be good. I was thinking that in future it could have Mashed-style racing -- the camera follows the whole pack around a decent-sized race-track, and if you fall too far behind you get kicked out. More levels and a racing mode have been added to my to-do list.

Of course, this will require a lot of work, since a decent sized racetrack should be much more complex than an arena. Also because I currently only do physics in 2D blush But that'll change. I don't mind a lot of work. And I've always enjoyed physics programming.

For replay mode I currently have an array of "states" -- a state is relatively simple since there can't be more than 4 cars at the moment, and each one is fairly basic. The states contain as little information as possible to replicate the current state of the game. Each "replay car" is a new entity (the actual cars are hidden) with its own action to kick up dust when it's losing grip, to rev the engine depending on its speed and the recorded input of the player, to align and rotate its wheels appropriately, to lean in the right direction according to changes in its velocity, and to glow and expand when it is out of bounds.

Each state also contains the time at which it was created. Playing back a replay involves incrementing a replay timer, and moving through the array until we're sitting between the state that should occur before this time and the state that should occur afterwards. Then it's just a matter of simple interpolation. States are automatically recorded every 16th of a second when the game is unpaused, with additional states inserted to make sure collisions are always perfectly replicated and explosions are never missed. Since it's simply a matter of interpolation between two states, I could very easily have an interface to scrub forward and back through the replay arbitrarily, although during backwards play I wouldn't want to create particles, nor play the same sounds.

These game-states will be the basis for my online multiplayer, although they'll be even further simplified, sent on a less regular basis, and I'll have to use some smart extrapolation rather than simple interpolation.

Thanks for the feedback laugh

Jibb


Formerly known as JulzMighty.
I made KarBOOM!