I
I
Ivan Wagner2018-10-31 16:04:46
Animation
Ivan Wagner, 2018-10-31 16:04:46

How to make roulette animation?

Good day! The essence of the question is this:
There is a game, there are items in it, there is an item as an example, using which you get a random list of prizes from the function, using the random method:

function Box($id){
  if(item_isset(18,1)){
    switch($id){
      case 116:
        $rand = rand(1,100);
        if($rand >= 1 && $rand <= 5){
          $rand1 = rand(1,3);
          if($rand1 == 1){
            plusEgg(false,false,false,true,false,519);
            $_SESSION['text'] = 'Вы получили: Яйцо #519 Пидов';
          }elseif($rand1 == 2){
            plusEgg(false,false,false,true,false,686);
            $_SESSION['text'] = 'Вы получили: Яйцо #686 Инкей';
          }else{
            plusEgg(false,false,false,true,false,570);
            $_SESSION['text'] = 'Вы получили: Яйцо #570 Зоруа';
          }
        }elseif($rand >= 6 && $rand <= 21){
          $rand2 = rand(1,3);
          if($rand2 == 1){
            itemAdd(7,10);
            $_SESSION['text'] = 'Вы получили: Ягода Леппа (10 шт.)';
          }elseif($rand2 == 2){
            itemAdd(8,10);
            $_SESSION['text'] = 'Вы получили: Ягода Оран (10 шт.)';
          }else{
            itemAdd(9,10);
            $_SESSION['text'] = 'Вы получили: Ягода Печа (10 шт.)';
          }

The goal is to make a visual animation of how it falls out, i.e. something like a drum or a linear roulette as in the COP.
As an example, you can take this - https://codepen.io/canvasplay/pen/YZgadm

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question