JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.4.2/phaser.min.js"></script>
JavaScript
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create });
function preload() {
game.load.image('pic', 'assets/pics/game14_angel_dawn.png');
}
var sprites, i = 0;
function create() {
game.stage.backgroundColor = '#2d2d2d';
// And the sprite we'll drag
sprites = [game.add.sprite(300, 300, 'pic'), game.add.sprite(100, 100, 'pic')];
scaleTween = game.add.tween(sprites[i]).to({height: 100, width: 100}, 400);
game.time.events.loop(300, scale);
}
function scale() {
scaleTween.stop();
i = (i + 1) % 2; // If this is commented it works on one sprite
sprites[i].width = 1;
sprites[i].height = 1;
scaleTween.target = sprites[i];
scaleTween.start();
}