Autor Tema: Cyclical scrolls and processes  (Leído 8196 veces)

Imerion

  • Jr. Member
  • **
  • Mensajes: 69
  • Karma: 3
Cyclical scrolls and processes
« en: Febrero 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).
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

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Cyclical scrolls and processes
« Respuesta #1 en: Febrero 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?
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

  • Jr. Member
  • **
  • Mensajes: 69
  • Karma: 3
Re: Cyclical scrolls and processes
« Respuesta #2 en: Febrero 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!
Try my games : Neotron Games

Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
    • TRINIT Asociación de Informáticos de Zaragoza
Re: Cyclical scrolls and processes
« Respuesta #3 en: Febrero 17, 2010, 07:33:27 pm »
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