JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser-ce/2.9.4/phaser.js"></script>

JavaScript

var game = new Phaser.Game(600, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render:render});


function preload() {

    game.stage.backgroundColor = '#000000';

   game.load.image('arrow', 'http://www.html5gamedevs.com/uploads/monthly_2018_06/mask_final.png.973237e0bc1463bee978a07adf30c85e.png');
    
}



function create() {

    game.stage.backgroundColor = '#000';

   
     arrow = game.add.image(90, 36, 'arrow'); 
 
      widtharrow = new Phaser.Rectangle(0, 0,arrow.width, arrow.height); 
 
     arrow.cropEnabled = true;
     arrow.crop(widtharrow);     
     arrow.fixedToCamera = true;
    
     widtharrow.width = 0; 
    
    game.time.events.loop(800,  function() {
	  game.add.tween(widtharrow).to( { width: (widtharrow.width + 60) }, 200, Phaser.Easing.Linear.None, true);
			}, this);     

}


function update() {
arrow.updateCrop();

if(widtharrow.width >= 300){
  game.add.tween(widtharrow).to( { width: (widtharrow.width - arrow.width) }, 200, Phaser.Easing.Linear.None, true);
}

}

function render() {


}