Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: ginanubismon on Tue 02/03/2010 16:59:35

Title: Solved(2.7.2)Animating an object while scrolling?
Post by: ginanubismon on Tue 02/03/2010 16:59:35
I was curious if it is possible to set up an object to animate while the screen scroll (I.E. Animate on Loop X, frame X if screen is scrolling X 5.)

Thanks for the help.

P.S. I am not telling what it's for except for the most technical aspects, it's a secret...
Title: Re: (2.7.2)Animating an object while scrolling?
Post by: EnterTheStory (aka tolworthy) on Wed 03/03/2010 08:42:27
Yes. Just use animate (no blocking) and repeatedly_execute_always to check "animating" and restart the animation if it ever stops. If it's absolutely essential that your animation never restarts but always carries on at the right frame, there is a command for getting/setting the frame, I just can't remember its name.
Title: Re: (2.7.2)Animating an object while scrolling?
Post by: Khris on Wed 03/03/2010 11:21:32
Not sure what exactly you're after (what do you mean by "scrolling X 5"?), but you can't set an object's frame directly.
Just use a character instead, then come up with a formula.

  cObj.Frame = (GetViewportX() / 10) % 5;

This will cycle through frame 0-4 while the background scrolls.