There is an application, a flappy bird clone, at death, a file is played. It is required to make so that not one file is played, but random from the list.
Code:
// столкновение с землей if (Intersector.overlaps(fly.getCircle(), ground)) { if (fly.isAlive()) { ResourseLoader.dead.play(); // 1 трек ResourseLoader.dead2.play(); // 2 трек ResourseLoader.dead3.play(); // 3 трек fly.die(); renderer.prepareTransition(255, 255, 255, 0.3f); } movHandler.stop(); currentState = GameState.GAMEOVER; //лучший результат highScore(); } How to implement it?