Jump to content

After clicking player1, player should animate or add tweens, but here its not working?


Recommended Posts

var config = {
type: Phaser.AUTO,
parent: 'phaser-example',
scene: {
preload: preload,
create: create,
update: update
width: 800,
height: 600
var game = new Phaser.Game(config);
var player;
function preload()
this.load.baseURL = '//examples.phaser.io/';
this.load.crossOrigin = 'anonymous';
this.load.image('dude', 'assets/sprites/phaser-dude.png');
function create()
player= this.add.sprite(256,50,'dude');
player1= this.add.sprite(256,150,'dude');
player1.on('pointerdown', function(){
targets: player,
x: 500,
duration: 1000,
delay: 1000
function update()
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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