Making clouds move across multple rooms at once.

Started by ZZjZmoz, Sat 10/05/2003 20:35:02

Previous topic - Next topic

ZZjZmoz

I'm perplexed by this situation. Wht do I do to get a cloud sprite to move across 3 different rooms. Each room is connected to each other in a way that, if they were put together in one room, they ould make a trailer. What I want, however, is to get effect of a cloud tht would move across a scrolling room in 3 seperate rooms.

I alrady have an idea of this using MoveObject, or something, and Global Variables.

First, I create 3 objects in the different rooms.

Next, I add 640 + 640 + 640 width of all of the rooms to get 1920 pixels. Then, I create a counter from 0 (minus the width of the cloud. If the cloud is 70 pixels, it should start at -70) to 1920. When it reaches 1920, it should go back to 0 (minus the width of the cloud.)

With all that crap figured out, all I need to do now is get the cloud to act for each room independantly. I mean, who wants a cloud at 1920 pixels in a 640 pixel width room? So, fo every room, I change the script so that room 1 starts at 0 pixels, room 2 starts at -640, and room 3 at -1280. That should get the desired effect.

All I need t know is if this will work. Would any willing participants tell me if this works? Or tell me how to make it work?

Thanks in advance.

Released Late August 2007

RickJ

I don't see why something like this couldn't work.  Subtract an offset from the counter in each room acccording to that room's relative position as you suggest.  Then if the adjusted position is less than 0 or greater than 640 turn the object off so that it is not visible.  I guess 0 and 640 will need to be adjusted a bit to accoun for the width of the cloud as you also have mentioned.  But I think you get the idea.   Evaluate if the cloud should be on or off in the "before fade-in" interaction as well as the room's "repeatedly execute" interaction.   Let us know how it turns out.

You cold also make a really wide room, say 1920 pixels wide and let AGS scroll across the width.  Then you would only need to move the object in one room.

ZZjZmoz

Thanks, Rick. I'm going to use the cloud in MFM Inc.'s upcomming game, ShipLife.

Released Late August 2007

BlackBaron

I'm not sure if this will help, but I think you should make the cloud a character instead of an object, remember that characters are room independent.
"Do you thirst for knowledge no matter the cost?"
            -Watrik, master glassblower

ZZjZmoz


Released Late August 2007

SMF spam blocked by CleanTalk