Bennu Game Development

English Forums => Helpdesk => Topic started by: Imerion on February 16, 2010, 03:36:35 PM

Title: Cyclical scrolls and processes
Post by: Imerion on February 16, 2010, 03:36:35 PM
I have been thinking about this problem for a while now, but I can't seem to find a solution.
In a game I am working on, I have a cyclical scroll. That is, it repeats. (Using the lockindicator flag, http://wiki.bennugd.org/index.php?title=Start_scroll (http://wiki.bennugd.org/index.php?title=Start_scroll)).
The scroll loops fine, but I also need objects in the scroll to repeat the same way.
For example, if I place a process at the middle of the screen and move the camera right until the scroll reaches that same position again I want the process to move right with the scroll and eventually be in the middle again. It's a bit hard to explain, but I want everything in the scroll to repeat the same way the scroll does. As it is now the coordinates of the scroll just increases infinitely when moving in the same direction, even though it's graphics (but no processes) repeats.

Does anyone know how to achieve the effect I am looking for?
Title: Re: Cyclical scrolls and processes
Post by: Windgate on February 16, 2010, 07:55:12 PM
You can get the scroll height and width using graphic_info ( )

Then you can have a GLOBAL value (int times_repeat) that indicates how many times the scroll has been repeated. The x,y variables of you main character between the width info of the scroll would be that number.

With this you can make all processes to stay on x*times_repeat...

Could it help you?
Title: Re: Cyclical scrolls and processes
Post by: Imerion on February 17, 2010, 01:58:08 PM
Yes, something like that could work. I was thinking along those lines, but it will be a bit hard to keep track of all objects since I still have to check if each object is outside the screen so I can make them wrap around. It should be possible to do with get_real_point() though. I'll try it and see. Thanks for the help!
Title: Re: Cyclical scrolls and processes
Post by: Windgate on February 17, 2010, 07:33:27 PM
It shouldn't be difficult, try it and show us the code if you have more doubts :D