Quote from: Khris on Wed 09/05/2012 17:35:16
For a small background animation you can use an object instead. Look up Object.Animate in the manual.
If you still want to do it using background frames:Code: ags // inside room_RepExec() if (IsTimerExpired(1)) { nbf = (GetBackgroundFrame() + 1) % 4; SetTimer(1, 400*(nbf==0) + 5*(nbf>0)); SetBackgroundFrame(nbf); }
Final step: if it doesn't exist, add the after fadein event and in there, call SetTimer(1, 1); to start things off.
Thanks for your help i got it to work using a timer with my original code

function room_RepExec()
{
if (IsTimerExpired(1)) {
SetBackgroundFrame(1);
Wait (5);
SetBackgroundFrame(2);
Wait (5);
SetBackgroundFrame(3);
Wait(5);
SetBackgroundFrame(0);
SetTimer(1, 200);
}
}
function room_AfterFadeIn()
{
SetBackgroundFrame(0);
SetTimer(1, 200);
}