moving BG elements

Started by , Sun 27/03/2005 20:05:04

Previous topic - Next topic

Kprojekt

This is my first time using AGS. I went through the tutorial and understand the basic concepts, now I'd like to go through and create some dynamic scenes.
My question, how would I go about having animated elements int he background without using the limited frame animation on the background.

What Im trying to do:  Well I'd like to create some cutscenes that involves a picture of city. In the  background I want the sky to move from left -> Right and loop.  Also meteors falling from the sky with animated smoke.

If there is plenty scripting, could someone point me in the right direction?

Thanks.

strazer

You could, for example:

- Draw everything as complete animation frames, put them in a view, then animate an object with it -> Easy
- Animate the background only, then use additional objects for the meteors and move them across the screen manually
- If you want the looping for clouds or the like, make the clouds objects and move them across the screen

kprojekt

thanks, sorta...
I understand the whole view concept, but how would I go about puting an animated object in my room? Or even animate it manually for that matter.

strazer

Just go to the Room settings, create a new object and set its image to one of the imported animation frames so you can more easily move it to where it looks correct.
Then, in the "Player enters screen (before fadein)" interaction of the room, add a "Run Script" action, then put this in there:

Code: ags

  // script for room: Player enters screen (before fadein)

  SetObjectView(THEOBJECTNUMBER, THEVIEWNUMBER); // set the object to the view containing the animation frames
  AnimateObjectEx(THEOBJECTNUMBER, 0, 0, 1); // animate the object using loop 0 of the view you have just set it to


You might also want to set the object's baseline to the very top of the room so it's always displayed behind everything else.

kprojekt

Im not sure exactly how to link the object to a view animation.  So far I just used a character as the animation.
I'm slowly getting the hang of this, is there any example source rooms available for me to disect? Something complex like a cutscene

DoorKnobHandle

the demo game features some cutscenes... I am not exactly sure if that helps you but you should check it out if you didn't already...

to assign a view to an object use the SetObjectView command!

SMF spam blocked by CleanTalk