Solved(2.7.2)Animating an object while scrolling?

Started by ginanubismon, Tue 02/03/2010 16:59:35

Previous topic - Next topic

ginanubismon

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...
"I shall call thee, Roger Ellison David Nicouli Etcher Calvin Kevin Sue in honor of what kind of a big jack@$$ you had been to guys like me." ADR -01 Jabberwock Type on fanfiction writers.

EnterTheStory (aka tolworthy)

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.

Khris

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.

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


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

SMF spam blocked by CleanTalk