Lucas Posted April 6, 2014 Share Posted April 6, 2014 I am creating an online game .. and every time someone comes in, takes the phaser load a new image of the character .. And after loading the image 100%, need add animations motion. How can I do? For load.spritesheet add a function and it did not work .. I have a function called NewPlayer, which is called every time a new user connects. thx Link to comment Share on other sites More sharing options...
Pedro Alpera Posted April 6, 2014 Share Posted April 6, 2014 have you got any code you could share? You could use onLoadcomplete: http://docs.phaser.io/Phaser.Loader.html#onLoadComplete then you could use the tween class. Link to comment Share on other sites More sharing options...
Lucas Posted April 6, 2014 Author Share Posted April 6, 2014 Yes.. i created this: function preload(){ //....}function create(){ //....}function update(){ //....}function newPlayer(data){ //I want to put here to load a new tileset ... and after you finish loading the tileset, I will create an array with the information of the player.} Link to comment Share on other sites More sharing options...
rich Posted April 8, 2014 Share Posted April 8, 2014 Here, you'll need to dissect the code in this example, but it shows how to load files mid-game: http://examples.phaser.io/_site/view_full.html?d=loader&f=load+events.js&t=load%20events Link to comment Share on other sites More sharing options...
Recommended Posts