Re: [Flashcoders] Time adjusted / Framerate independent animation…

2012-10-26 Thread Karim Beyrouti
Ok - i needed variable speed per frame (so animation keeps in time with possible frame lag) . I guess where I get confused is: how would i structure this if I wanted the follower to for example follow the mouse (with an eased delay)?… Here is the code for now ( which is currently not really a

Re: [Flashcoders] Time adjusted / Framerate independent animation…

2012-10-26 Thread Karim Beyrouti
Thank you! That make sense. Will integrate this into my code ( now looking at my camera class ) … This is quite important, as if there is any frame lag, physics and other objects go out of sync. Karim Beyrouti t: +44 (0) 7977 997 629 e: ka...@kurst.co.uk w: http://kurst.co.uk skype: karimb

Re: [Flashcoders] Time adjusted / Framerate independent animation…

2012-10-26 Thread Hans Wichman
Hi Karim, i put them both in there, the one you are referring to is simpler: ofcourse this value can be kept out of the enterframe loop, i have a utility class for it (although it is a bit overkill;)) private function enterFrame( event : Event ) : void { sp.x += speed * spDir;

Re: [Flashcoders] Time adjusted / Framerate independent animation…

2012-10-26 Thread Karim Beyrouti
> are you trying to do frame rate independent animation based on a fixed frame > rate (eg you switch from 30 to 60 and everything should move at the same pace > but more fluid Yep - that is the one… all my game physics is independent of framerate (time based)… however, I am trying to get other n

Re: [Flashcoders] Time adjusted / Framerate independent animation…

2012-10-26 Thread Hans Wichman
Hi, are you trying to do frame rate independent animation based on a fixed frame rate (eg you switch from 30 to 60 and everything should move at the same pace but more fluid), or trying to make up a variable framerate due to running code? Anyway since you are keeping y constant I compressed

[Flashcoders] Time adjusted / Framerate independent animation…

2012-10-26 Thread Karim Beyrouti
Hello Flash coders, It's been a little quite here of late… So, hope it's good with with you all. … I have been trying to figure this out for a day or so, and wondering if you can help. I am trying to time correct my animation to be independent of framerate, which is a little easier when dealin