Jump to content

Randum animation duration


locomotive
 Share

Recommended Posts

Hello Phaser community ,
I am a new developer … was trying to make a simple 2D game , but struggled with some stuff
because my programming knowledge is poor …
The game Idea is
When the pointer down an animation start (BOSSTALKS)
Here is the animation code

var frameNames4 = this.anims.generateFrameNames('bossanim', {
                     start: 0, end: 26, zeroPad: 2,
                     prefix: 'bosstalks', suffix: '.png'
                     });

     this.anims.create({ key: 'bosstalks', frames: frameNames4, frameRate: 10});

Now this animation duration is the same everytime it plays … what i need to do is to make the duration randomly generated … this animation its a phone call so i need it for example to last 5 sec the first time 15 sec the second time …
Sorry for my bad use of english and thank you in advance .

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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