Issues with Timers not actually keeping exact time - moving Actor

arcticsunrisearcticsunrise Member Posts: 159
edited July 2012 in Working with GS (Mac)
Im wanting to have some 'waves' on my new game and they are basically a hand drawn actor so i am animating it by moving the actor up and down slowly.


Ive set a rule with 2 timer functions and it doesnt seem to keep time - basically the wave tends over time to drift up and off the screen!

RULE:every 2 seconds run to completion
for 1 second run to completion
move up speed of 10
after 1 second run to completion
move down speed of 10

this does make the wave go up and down but then after maybe 30 seconds ive noticed it has drifted up and after 5/10 minutes its gone up off the screen.

if i set the rule to go down first and then up then over time it slowly drifts down

any ideas why?


either i need a fix to this (or is it a timing bug) or i need a much better way because i have lots of these and other 'moving' actors and timers eat up resources im sure

Best Answers

Answers

  • arcticsunrisearcticsunrise Member Posts: 159
    cheers guys so busy i didnt come back.

    used a few timer optimisations but actually in the end started thinking about my maths and using sin / cos within the speed parameter of a move behaviour and that gave me up and down movement so exactly what i needed for my waves and they never go out of sync. ever. and dont need a timer. yay.
Sign In or Register to comment.