Jump to content

How to create a bounce in a tween.


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);


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. 



Any help will be appreciated.

Link to comment
Share on other sites


  • Recently Browsing   0 members

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