Lets say your existing camera code is started by calling
Normal_Camera_Action();With the code below, the
Camera_OneFrame_Function() processes JUST ONE frame of your camera code,
and
Normal_Camera_Action() calls it once a frame, just like a normal camera action.
When YOUR function eg
Freezer turns the freeze on,
Normal_Camera_Action() will freeze, stopping the camera.
BUT, if you keep calling
Camera_OneFrame_Function() from INSIDE
Freezer (once a frame),
it will appear to still be running normally.
This is a pretty rough example, but is shows what I mean, I hope.
//
action Normal_Camera_Action()
{
while(1)
{
Camera_OneFrame_Function();
wait(1);
}
}
//
function Camera_OneFrame_Function()
{
//normal contents of camera action while loop
if(key_w) camera.x += 5 * time_step;
if(key_s) camera.x -= 5 * time_step;
if(key_a) camera.y += 5 * time_step;
if(key_d) camera.y -= 5 * time_step;
}
//
function Freezer()
{
freeze_mode = 2;
while(freeze_mode==2)
{
//do whatever you need to do, if it happens here.
if(key_esc) freeze_mode = 0; //eg to abort freeze mode
//
Camera_OneFrame_Function(); //draw another frame
wait(1);
}
}
//
Lemme know how it goes.