Author Topic: Wait function stops background object movement  (Read 202 times)  Share 

Wait function stops background object movement
« on: 29 Jul 2012, 09:59 »
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: Adventure Game Studio
  1. oStarsHor.Move(0, 200, 1, eNoBlock, eAnywhere);

room_RepExec:
Code: Adventure Game Studio
  1. if (oStarsHor.Y == 200) {
  2. oStarsHor.Y = 600;
  3. oStarsHor.Move(0, 200, 1, eNoBlock, eAnywhere);
  4. }

room_AfterFadeIn:

Code: Adventure Game Studio
  1. Wait(180);
  2. Overlay* myOverlay = Overlay.CreateTextual(50,80,300,5,11,"Blah blah blah");
  3. Wait(160);
  4. myOverlay.SetText(0,Game.SpeechFont,15,"");
  5. Wait(80);
  6. myOverlay.SetText(300,5,11,"Blah blah blah");
  7. Wait(160);
  8. etc. etc.

Thanks in advance!

Re: Wait function stops background object movement
« Reply #1 on: 29 Jul 2012, 10:19 »
room_RepExec is subsceptible to block functions, use repeatedly_execute_always() instead (you don't need to link it to the room events).

- Alan

Re: Wait function stops background object movement
« Reply #2 on: 29 Jul 2012, 12:52 »
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!
« Last Edit: 29 Jul 2012, 12:58 by Sparkiller »