locomotive

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. locomotive

    looped timed event with random delay

    That did the job , i am very thankful
  2. locomotive

    looped timed event with random delay

    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