Jump to content

tween


sergil
 Share

Recommended Posts

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

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

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

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

 Share

  • Recently Browsing   0 members

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