Jump to content
Search Community

Moving a tweening object

cr4y test
Moderator Tag

Recommended Posts

I'm writing a game. A main character, "board.player" should be visible always in center of the screen. To make life easier I have done something like:

addEventListener(Event.ENTER_FRAME,erf);
function erf(ev:Event){
   board.x= -board.player.x
}

TweenMax.to(board.player, 2, {x:"+100"});

 

Now I can move player, and he is still in center of the screen. The problem is that "player" is shaking (his tween is no fluent). It seems like "erf" is running before TweenMax. How could I change it? (I was trying to change a priority of ENTER_FRAME listener, but it didn't help).

 

Thanks in advance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...