Jump to content

Documentation


ema99
 Share

Recommended Posts

Hi all
 
 
i am newbie on framework pasher for html5. i like phaser but not found documentation about their class. 
 
for example i  found this following problem and i know not how to  functioned
 
function preload() {
 
 
game.load.atlasJSONHash('pj', 'img/running_bot.png', 'index/running_pj.json');
}
 
function create() {
 
pj = game.add.sprite(game.world.centerX, game.world.centerY, 'pj');
 
pj.animations.add('up');
 
pj.animations.play('up',['run00', 'run01', 'run02', 'run03', 'run04', 'run05', 'run06', 'run07', 'run08', 'run09', 'run10'] ,10, true, false);
 
pj.scale.x += 0.6;
 
pj.scale.y += 0.6;
 
 
 
}
 
 
the sprite is displayed but not animated
 
 
Sorry for my bad english,
 
thanks

 

Link to comment
Share on other sites

No 100% sure, but I think you want to add your run animation, then play it. Like so:

function create() {  pj = game.add.sprite(game.world.centerX, game.world.centerY, 'pj');//add the animation  pj.animations.add('up',['run00', 'run01', 'run02', 'run03', 'run04', 'run05', 'run06', 'run07', 'run08', 'run09', 'run10'] ,10, true, false);//play it  pj.animations.play('up');    pj.scale.x += 0.6;  pj.scale.y += 0.6;}
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.

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

Loading...
 Share

  • Recently Browsing   0 members

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