Change room when music ends [SOLVED]

Started by DCS78, Tue 10/04/2012 02:49:13

Previous topic - Next topic

DCS78

I want to be able to change rooms when my music ends and be able to skip on a button press. Each of the following scripts work as expected but I want to combine them. Any ideas?

Code: ags

function room_AfterFadeIn()
{
  while (!mouse.IsButtonDown(eMouseLeft) && !IsKeyPressed(13) && !IsKeyPressed(27) && !IsKeyPressed(32))
  {
    Wait(1);
  }

  player.ChangeRoom(3);
}


or

Code: ags

function room_AfterFadeIn()
{
  Wait(400);
  player.ChangeRoom(3);
}

Gilbert

Something like this should work:
Code: ags

function room_AfterFadeIn()
{
  int tempcount = 0;
  while (!mouse.IsButtonDown(eMouseLeft) && !IsKeyPressed(13) && !IsKeyPressed(27) && !IsKeyPressed(32) && tempcount<400)
  {
    Wait(1);
    tempcount++;
  }

  player.ChangeRoom(3);
}

DCS78

Thank you, works perfectly.

SMF spam blocked by CleanTalk