Alternative to using transition.* and delterPerFrame on the same object.

I don’t want to post duplicate threads and even though some of this content was covered here, this is somewhat of a different problem regarding the same issue.

Here I have a player object that moves up/down using deltaPerFrame and then moves back using transition. when they collide with another object. I decided to use deltaPerFrame in the up/down movement because I want that movement to be constant (no acceleration) however for the backward (left) directional movement, I was to use easing to create a “burst” motion and then slowing down at the end.

The problem I am running into is players cannot move up/down while they are moving backwards and it looks like lag or a glitch when it really isn’t. I just found out recently that transition. and enterFrame don’t play nice together. Does anyone have any ideas for some alternatives that can get this same behaviour? I thought I’d ask for some bright ideas before I deep dive into any code changes. Thanks.

Hello,

Transition and enterframe work quite bad together but that’s normal.

Transition are only an easy way to move an object.

Enterframe let you do everything.

I think you need only enterframe where you do everything.

For x moving it’s not changing (you add always the same value).

For y it’s changing when the player fall or move.

When the player go up, you have to move like this function   ( easing.inOutQuad ) to do that you don’t need transition you can use normal math :slight_smile:

When the player fall you have already the answer

If you want to do with only transition.

Have many transitions who don’t interact with the same parameter of the object

When the player go up or fall. Cancel some transitions and create new one.

I really don’t know what is the best solution for you because, transition are sometime smoother than enterframe (I don’t know why)

Hi elifares,

I agree with @remiduchalard. Try reproduce calculations done by transition function using easing functions from EmmanuelOga/easing project on github or build your own. 

Have a nice day:)

ldurniat 

Thanks for your suggestion guys! Looks like I’ll be using only enterFrame to do everything :slight_smile:

Cheers!

Hello,

Transition and enterframe work quite bad together but that’s normal.

Transition are only an easy way to move an object.

Enterframe let you do everything.

I think you need only enterframe where you do everything.

For x moving it’s not changing (you add always the same value).

For y it’s changing when the player fall or move.

When the player go up, you have to move like this function   ( easing.inOutQuad ) to do that you don’t need transition you can use normal math :slight_smile:

When the player fall you have already the answer

If you want to do with only transition.

Have many transitions who don’t interact with the same parameter of the object

When the player go up or fall. Cancel some transitions and create new one.

I really don’t know what is the best solution for you because, transition are sometime smoother than enterframe (I don’t know why)

Hi elifares,

I agree with @remiduchalard. Try reproduce calculations done by transition function using easing functions from EmmanuelOga/easing project on github or build your own. 

Have a nice day:)

ldurniat 

Thanks for your suggestion guys! Looks like I’ll be using only enterFrame to do everything :slight_smile:

Cheers!