Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Random Image Generation


Senthil_SKR
 Share

Recommended Posts

 

Hi friends,

 

var timerValue = 5;
    var timerchange=game.time.events.loop(Phaser.Timer.SECOND, function(){
        timerValue += 1;
        if(timerValue==1){
            BrandB1.visible = true;
            BrandB2.visible = false;
            BrandB3.visible = false;
            BrandB4.visible = false;
            BrandB5.visible = false;
        }else if(timerValue==2){
            BrandB1.visible = false;
            BrandB2.visible = true;
            BrandB3.visible = false;
            BrandB4.visible = false;
            BrandB5.visible = false;
        }else if(timerValue==3){
            BrandB1.visible = false;
            BrandB2.visible = false;
            BrandB3.visible = true;
            BrandB4.visible = false;
            BrandB5.visible = false;
        }else if(timerValue==4){
            BrandB1.visible = false;
            BrandB2.visible = false;
            BrandB3.visible = false;
            BrandB4.visible = true;
            BrandB5.visible = false;
        }else if(timerValue==5){
            BrandB1.visible = false;
            BrandB2.visible = false;
            BrandB3.visible = false;
            BrandB4.visible = false;
            BrandB5.visible = true;
            timerValue=0;
        }else{
            game.time.events.remove(timerchange);
        }
        });

 

This is my code. I'm having 5 images, see BrandB1, BrandB2,...BrandB5, I need to display those images one by one with the time period of 1 second. Can Anyone help me...

 
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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