Jump to content
Search Community

TimelineMax + TweenMax.allTo & .to strange behaviours

Miroku_87 test
Moderator Tag

Recommended Posts

Hi everyone,

in making the AI movements in a card game I thought of using TimelineMax and TweenMax together.

While using them I ran into a few strange behaviours.

 

The first code I've tried and used is this

http://pastebin.com/K7ieNz2E

 

as you see I've got three functions running when a GameEvent is dispatched. They are written in the order the events are fired.

So in the first I instantiate the timeline putting an onComplete function, in the second I make the AI played cards move and in the end I move the AI discarded card.

Here is a video of what happens with this code:

http://dl.dropbox.com/u/4064417/StrangeBehaviour1.avi

as you see everything is as expected from the code except for the tween at line 31 and the last one. In fact we see the instruction at line 31 being excecuted but then happens something strange. The tween is reversed and everything stops. The last tween is never been executed (apparently) and the timeline never reaches the onComplete function (I can check it because I don't see the trace of that function).

I notice that tweens at line 31 and 32 are the only ones with TweenMax.to and not .allTo .... will it be important?

 

So I tried another way. This one:

http://pastebin.com/JH5KfdtW

 

here is the result:

http://dl.dropbox.com/u/4064417/StrangeBehaviour2.avi

what a mess! Where the tweens at line 25 and 26 had gone? And why is it tweening just the width of the instruction at line 27 and not the height?

 

While debugging I've tried and commented line 27 (the highlighted one) and here is the result:

http://dl.dropbox.com/u/4064417/StrangeBehaviour3.avi

everythings runs fine except that I obviously don't have what line 27 should make happen.

 

This leads me to this question:

is it me? am I missing something very wrong in my code? if yes, what?

 

Hope someone will help me.

Thank you very much =)

Link to comment
Share on other sites

I'm very glad to hear you got it fixed. I studied your code for a bit but nothing jumped out at me. I think I got lost trying to interpret the various versions.

I was very impressed with what you accomplished with all the card shuffling.

nice work.

 

Carl

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...