Wait function stops background object movement

Started by Sparkiller, Sun 29/07/2012 09:59:13

Previous topic - Next topic

Sparkiller

Hi everyone!

For the intro of my current project i'm trying to have a background of moving stars (via object and room_RepExec), while the Text (overlay in room_AfterFadeIn) displays in front of it.
The Move-function in room_load works fine, but using the Wait-function seems to interrupt/stop the background loop and i can't figure out why. Here is the code i'm using:

room_load:
Code: AGS
oStarsHor.Move(0, 200, 1, eNoBlock, eAnywhere);


room_RepExec:
Code: AGS
if (oStarsHor.Y == 200) {
oStarsHor.Y = 600;
oStarsHor.Move(0, 200, 1, eNoBlock, eAnywhere);
}


room_AfterFadeIn:

Code: AGS
Wait(180); 
Overlay* myOverlay = Overlay.CreateTextual(50,80,300,5,11,"Blah blah blah");
Wait(160);
myOverlay.SetText(0,Game.SpeechFont,15,"");
Wait(80);
myOverlay.SetText(300,5,11,"Blah blah blah");
Wait(160);
etc. etc.


Thanks in advance!

Alan v.Drake

room_RepExec is subsceptible to block functions, use repeatedly_execute_always() instead (you don't need to link it to the room events).

- Alan

Sparkiller

#2
Quote from: Alan v.Drake on Sun 29/07/2012 10:19:54
room_RepExec is subsceptible to block functions, use repeatedly_execute_always() instead (you don't need to link it to the room events).

That solved it! Thank you for your fast response!

SMF spam blocked by CleanTalk