Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: KANDYMAN-IAC on Tue 27/04/2004 02:36:36

Title: independant scrolling foreground and background... is it possible???
Post by: KANDYMAN-IAC on Tue 27/04/2004 02:36:36
Ok, i've been playing broken sword 2 recently, and noticed that in a lot of (if not all scenes) there is a forground that scrolls independantly to the background...

Is this possible to create in ags?? i have made some sketches and want to use it myself but can 't figure how to script it.

it logically should work like this... the background is actually the interactive scene, the foreground is shorter in width, and takes up very minimal amount of space, but gives the illusion of the room having definiate shape all around.

when the character walks along a long room the foreground (that is shorter than the background) scrolls at the same time as the scene the character is walking through, but at a slower speed to compensate.  So that the foreground doesnt run out before the end of the screen.

How would i accomplish this???
Title: Re:independant scrolling foreground and background... is it possible???
Post by: Gilbert on Tue 27/04/2004 02:43:50
Well, use an object/character/graphics overlay that's placed on top of the screen, and control its position via script.

(Or use plugins, I think the parallax scrolling plugin is for this sort of things, but as I never care for plugins, I'm not sure.)
Title: Re:independant scrolling foreground and background... is it possible???
Post by: Scummbuddy on Tue 27/04/2004 02:59:47
its called parallex scrolling. Someone, who didn't mention themselves in a readme file, nor in the global script, made 'Parrallax Demo View v1.0' which I have and is not out of date. I also seem to be missing a .dll file associated with this. Basically the template shows mountains being moved.
Heres a zip file of everything I had with this previous download.


Parallex scrolling (http://www.2dadventure.com/ags/Parallex_scrolling.zip)
Title: Re:independant scrolling foreground and background... is it possible???
Post by: Hollister Man on Tue 27/04/2004 03:04:49
That's parallax, with three a's, not all in a row.  (Well, that's how my programming class book recorded it.)

I think the idea KM is looking at is slightly different, actually the opposite.  Where regular parallax makes objects in the distance appear to be moving slower, KM is talking about a "frame," such as if someone were looking through a window.  They could always see the frame, but could also "scroll" their view around inside the room.
Title: Re:independant scrolling foreground and background... is it possible???
Post by: KANDYMAN-IAC on Tue 27/04/2004 03:07:26
Hollister man has got it quite right....
Title: Re:independant scrolling foreground and background... is it possible???
Post by: Gilbert on Tue 27/04/2004 03:08:04
It's a test of scorpious' parallax plugin, which I mentioned. The plugin can be found here here (http://geocities.com/scorpiorus82).
Title: Re:independant scrolling foreground and background... is it possible???
Post by: Gilbert on Tue 27/04/2004 03:56:48
Alright, I tried and hacked the demo to not using that plugin. You may try it out if you like:
http://s11.yousendit.com/d.aspx?id=8ECB6BDD09E2ADD19E19A8CC3B93C2A7 (http://s11.yousendit.com/d.aspx?id=8ECB6BDD09E2ADD19E19A8CC3B93C2A7)
(7 days left ;D)

(You may need  at least V2.6sp1 to compile it)

EDIT: didn't see the frame comments, but for a frame, it's even simpler, just use a overlay or a GUI as the frame, and it won't scroll automatically with the background.
Title: Re:independant scrolling foreground and background... is it possible???
Post by: Scummbuddy on Tue 27/04/2004 07:24:43
heh, i thought it was parallax, but the folder i found it in on my harddrive said parallex, so i went with it.  :D
Title: Re:independant scrolling foreground and background... is it possible???
Post by: strazer on Tue 27/04/2004 08:02:21
Excellent. Thanks Gilbert!
I try to avoid plugins as much as I can, it's just that SnowRain plugin that is sooo tempting... :)
Title: Re:independant scrolling foreground and background... is it possible???
Post by: Scorpiorus on Tue 27/04/2004 19:59:41
Quote from: Scummbuddy on Tue 27/04/2004 07:24:43
heh, i thought it was parallax, but the folder i found it in on my harddrive said parallex, so i went with it.  :D
hehe, the first version was indead mistakenly called parallex. I had corrected the mistake but forgot to update the plugins page (done now) :)
Title: Re:independant scrolling foreground and background... is it possible???
Post by: Hollister Man on Wed 28/04/2004 02:23:02
Quotethe first version was indead mistakenly called parallex

First parralex and now indead... lol
Title: Re:independant scrolling foreground and background... is it possible???
Post by: Scorpiorus on Wed 28/04/2004 12:43:40
<offtopic>

Heh, this time it's 'a' instead if 'e'. Well, I should sleep a little more... and I wish I had a chance.

~Cheers