my question is about the error: Uncaught Referenceerror: createSlider is not defined

Asked

Viewed 44 times

0

I’m doing a game in the style of "Flappy Bird" but I’m having a problem with Slider, the project is not my original he comes from the channel "the codding Train,Coding Challenge #41: Clappy Bird!" he uses this variable exactly in 11:42 in the video leave attached the link and the code.

var bird; //variável passaro
var pipes = []; //variavel das paredes
var mic;
var slider;

function setup() {
   createCanvas(400, 600); //tamanho da janela 400x600
   mic = new p5.AudioIn(); //para chamar a biblioteca de microfone
   mic.start(); //para aparecer o pop up no navegador para aceitar a usar o    microfone
   bird = new Bird(); //para mostrar o passaro na tela
   pipes.push(new Pipe()); //para mostrar as paredes
   slider = createSlider(0, 1, 0.2, 0.01);
}

1 answer

0

You’re right, you need to include a dependency to get the job done createSlider.

In your HTML you have to import the p5js library, because it is the one that provides the function createSlider.

You can see the full code he created on github repository.

  • correct,thank you very much from heart!!! I had the library but it was more updated and there was problem with it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.