Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Thu 02/03/2006 14:13:27

Title: Problems with the moving backgrounds
Post by: on Thu 02/03/2006 14:13:27
Hi!
I've already made a game in AGS, now I want to start a new one but I have a question:

How can I make the backgrounds move? (As it happens in Monkey Island games)

I don't mean animation like clouds in the sky, I mean that when the player reaches the left/right srceen edge, the background shows the player what's though that direction.

I'm not sure if I've explained myself.

Thanks
Title: Re: Problems with the moving backgrounds
Post by: Babar on Thu 02/03/2006 14:39:20
Yes you can. I think it's mentioned in the BFAQ. It has something to do with SetViewport.
Title: Re: Problems with the moving backgrounds
Post by: Saberteeth on Thu 02/03/2006 15:11:02
Yeah, you can do it with SetViewport but the easiest way to do it is just to draw bgs larger(in width for left-right, in height for up-down) than your resolution.

It's explained in your AGS help file...
Title: Re: Problems with the moving backgrounds
Post by: Ashen on Thu 02/03/2006 18:43:29
To clarify:
If you want the screen to smoothly follow the character as they move, just make the background image wider than the game's resolution (i.e. 320, 640 or 800), and AGS handles it automatically.
If you want to force the movment of the screen, you'd use SetViewport(x,y). (For example, the screen is locked in place until the player character nears the right edge, when it scrolls along the the second half of the screen, with the player now stood on the left.)

(The same would be true for vertically scrolling rooms, too.)