Jump to content

alpha sprite


valentinaCom
 Share

Recommended Posts

hi :)

 

I have a game in which each question in level have a different number of kids (spritesheets) on stage.

I load and add all the spritesheets of kids when level start, however I turn all kids to alpha=0 (in each question are different kids). when a new question start, the kids needed turn to alpha 1.

 

Until now I have maximum 2 kids at the same time in question and it's work perfectly. However I made a new level with 3 kids. 

When I turn the 3 kids to visible, the game becace really slow and I don't know why.. if I put the command alpha as a comment, it's work fine again (just that the kids are steel alpha 0).

 

Doesn't work: 

 

playAnim:function (id) {
        this[id].alpha = 1;
        this[id].animations.add('run');
        this[id].animations.play('run', 15, true);
    },
 
Work: 

 

playAnim:function (id) {
        // this[id].alpha = 1;
        this[id].animations.add('run');
        this[id].animations.play('run', 15, true);
    },
 
Can anyone tell me what's the problem??
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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