sergil Posted October 28, 2013 Share Posted October 28, 2013 I was thinking on moving the sprite (it represents a bubble) using body.velocity.x and body.velocity.y and using a tween chain for: 1. scale x from 1 to 0.8 and scale y from 1 to 1.22. scale x from 0.8 to 1 and scale y from 1.2 to 1 3. scale x from 1 to 1.2 and scale y from 1 to 0.8 4. scale x from 1.2 to 1 and scale y from 0.8 to 15. loop how can I do the scale chain? it's better use the tween chain or have the movement in a spritesheet? thanks Link to comment Share on other sites More sharing options...
rich Posted October 28, 2013 Share Posted October 28, 2013 There is an example of chaining multiple tweens together in the Examples suite, so you could copy that method for sure. There's also a TweenGroup extension in development, but not quite integrated into the main core yet. Link to comment Share on other sites More sharing options...
sergil Posted October 29, 2013 Author Share Posted October 29, 2013 Looking at the examples I use: s = this.game.add.tween(this.spr_bubble.scale); s.to({x: 0.95, y:1.05}, 500, Phaser.Easing.Linear.None); s.to({x: 1.00, y:1.00}, 500, Phaser.Easing.Linear.None); s.to({x: 1.05, y:0.95}, 500, Phaser.Easing.Linear.None); s.to({x: 1.00, y:1.00}, 500, Phaser.Easing.Linear.None); s.loop() .start(); and it works great what is the TweenGroup extension ? another question... i want to move the sprite vertical, but I want to use a sinusoidal movement... how can I achieve this? using body.velocity.x perhaps? Link to comment Share on other sites More sharing options...
Recommended Posts