• Content Count

  • Joined

  • Last visited

  1. 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 .
  2. Hello , i am new to building games , started my phaser3 journey one week ago , i am trying to make a looped timed event run multiple times , each time a different delay , so for example instead of making the event run every 5 sec as this line of code does : phonecall = this.time.addEvent({ delay: 5000, loop: true, callback: onEvent, callbackScope: this }); i need it to run at random intervals from 5 to 30 secs ( ex : first time 5 sec second time 10 sec third time 7 sec) any value between the interval i set , i tried to do this : phonecall = this.time.addEvent({ delay: Phaser.Math.Between(5000,30000), loop: true, callback: onEvent, callbackScope: this }); but it seems that its not working .. sorry for my bad use of English , thanks