Cyclical scrolls and processes

Started by Imerion, February 16, 2010, 03:36:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Imerion

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).
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?
Try my games : Neotron Games

Windgate

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?
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

Imerion

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!
Try my games : Neotron Games

Windgate

It shouldn't be difficult, try it and show us the code if you have more doubts :D
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es