Jump to content

How to create a bounce in a tween.


WiLD11
 Share

Recommended Posts

Hello, I have a tween which looks like this:

var tween = game.add.tween(ball).to({ x: g.balls.children[i - direction].x - 64,y:g.balls.children[8 * row].y }, this.game_speed);

tween.start();

Now I want it to do a little bounce every time this tween gets ran, I have tried:

game.add.tween(ball).to({ y: g.balls.children[8 * row].y}, this.game_speed * 0.5, Phaser.Easing.Sinusoidal.Out).to({ y: g.balls.children[8 * row].y - 128 }, this.game_speed * 0.5, Phaser.Easing.Sinusoidal.In).start();

but it doesn't look right, it somehow feels like its sliding. 

 

c737a9b3f7bc2552c63846beceb18cf7.gif

Any help will be appreciated.
 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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