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

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