Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Nabeel on Sat 30/06/2007 05:08:29

Title: Moving the screen
Post by: Nabeel on Sat 30/06/2007 05:08:29
Umm...I wanted to ask, how can you let the player move the whole screen?
Like in 6 Days Assasin when we were to shoot the Sniper...
Title: Re: Moving the screen
Post by: TerranRich on Sat 30/06/2007 06:22:12
Haven't played 6DA in a long time...do you mean scrolling backgrounds? If so, just make the background larger than the room size (320x200 for example). You'll need some scripting for using the mouse to move the screen, however.
Title: Re: Moving the screen
Post by: R4L on Sat 30/06/2007 19:19:58
Quote from: TerranRich on Sat 30/06/2007 06:22:12
You'll need some scripting for using the mouse to move the screen, however.

You'll need to use Viewport commands. Look in the manual for more info on them.
Title: Re: Moving the screen
Post by: Lt. Smash on Tue 03/07/2007 16:20:20
you could create hotspots but better would to check if the mouse is left/right or up/down.

you may use this code(not tested but should work):


game rep execute:

if(player.Room==Scrollroom)
{
  if(mouse.x<20) //or room rep execute from here
  {
    SetViewport(GetViewportX()-1,0); //increase -1 for faster scrolling
  }

  else if(mouse.x>300)
  {
    SetViewport(GetViewportX()+1,0); //increase +1 for faster scrolling
  }
 
  else if(mouse.y<20)
  {
    SetViewport(0,GetViewportY()-1); //increase -1 for faster scrolling
  }

  else if(mouse.y>180)
  {
    SetViewport(0,GetViewportY()+1); //increase +1 for faster scrolling
  }
}


EDIT: fixed typo