ShakeScreenBackground at timed intervals (SOLVED)

Started by markbilly, Sun 18/03/2007 18:10:01

Previous topic - Next topic

markbilly

If this should be in beginners then I apologise.

I need to be able to run the ShakeScreenBackground at intervals of 30 seconds. At the moment I can only run it constantly in repeatedly_execute_always().

Something like would work:

ShakeScreenBackground(blah, 0);
Wait(500); (but without pausing the game or blocking)
ShakeScreenBackground(blah);

Thanks in advance.
 

GarageGothic

You just need to code a simple timer:

In the top of your script:
Code: ags
int shaketimer;


in repeatedly_execute_always
Code: ags

if (IsGamePaused == 0) { //you probably don't want the screen shaking while in the save menu etc.
   if (shaketimer > 500) {
      ShakeScreenBackground (4, 10, 80); // or whatever
      shaketimer = 0;
      }
   shaketimer++;   
   }


SMF spam blocked by CleanTalk