700 frames...a few frames...
SirCmpwn, what the Hell is your fps?
What I mean is that it is currently tracking 700 frames, which is about 30 seconds of rewinding time. I will eventually restrict the amount the player can actually rewind to a few seconds. The FPS is just over 20. Let me explain more about rewinding actually works:
First of all, every equation in the whole thing, instead of saying "+1", "-2", etc, instead says "+M", or "-(2*M)". For example, the movement code says: "Y+(M*getKey(1))-(M*getKey(4))→Y" (I'll add better physics soon). M represents the time mode. When time progresses normally, M is 2. When paused, M is 0. When slowed down, M is 1, and 4 when fast forwarding.
Rewinding is handled somewhat differently. I use the variable K to store the current keypress (getKey→K, plus some fancy stuff to handle multiple keys). Almost every place that would normally use a getKey(*) instead checks K. In addition to this, the value of K is logged every frame. When in rewind mode, instead of using "getKey→K" to set this frame's K value, it instead pulls a logged keypress and uses it. In addition to this, M is set to -2 while rewinding. What this all adds up to is that every action is reversed, and the keys are pressed in reverse order. This seems to me what the fastest and most efficient solution was.
I also have to keep track of some more things later on, like a list of destroyed objects and what time they were destroyed at, and perhaps some magic with physics (cause objects that stop have a velocity of 0, which is a big gaping hole for inverse equations).
Also, I have a decent demo, I just need to add more to it and pull it off my calculator for screenies. I'll be doing a lot of cool stuff for that, don't worry. It may be a while, since I'm quite busy with graduation and job hunting and such.