Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: markbilly on Tue 24/08/2010 12:51:30

Title: Indefinitely long ShakeScreenBackground (SOLVED)
Post by: markbilly on Tue 24/08/2010 12:51:30
Basically, I want the ShakeScreenBackground to keep going indefinitely until I abort it manually (by setting length to zero) how would I do this?

I have looked through a few threads but nothing has come up...
Title: Re: Indefinitely long ShakeScreenBackground
Post by: Calin Leafshade on Tue 24/08/2010 13:04:22
if you cant find a solution for ShakeScreen you could make the room a little bit bigger and mess with the viewport instead

Title: Re: Indefinitely long ShakeScreenBackground
Post by: tzachs on Tue 24/08/2010 13:06:27
Try running the background shake in small amounts in the repeatedly execute (but long enough to be carried until the next repeatedly execute), for as long as a certain boolean variable is true. Then when you want to stop the shaking, mark the variable at false.

Something like this:


bool ShakeScreen;

//when you want to start the shaking put
ShakeScreen = true;

//in repeatedly execute
if (ShakeScreen) ShakeScreenBackground(...);

//in some other function when you want to stop it:
ShakeScreen = false;


I haven't tried it but is should work.
Title: Re: Indefinitely long ShakeScreenBackground
Post by: markbilly on Tue 24/08/2010 13:43:35
Yeah that works, cheers tzachs! :)