Hello guys,
I got this error 4 times in my script. I am really a beginner, so I don’t understand how to fix those errors, it is the same error on 4 different positions. The script is a JS script which I am trying to implement in my project.
BUGGED SCRIPT PART 1
// Speed variables
var speedS = 1000000; var speedR = 100000; var speedF = 5000;
var vitesse = speedR;
// Speed function
Star.prototype.draw = function () {
var x = Math.sin(this.timePassed) * this.orbitRadius + this.orbitX, y = Math.cos(this.timePassed) * this.orbitRadius + this.orbitY, twinkle = random(10);
if (twinkle === 1 && this.alpha > 0) {
this.alpha -= 0.05
} else if (twinkle === 2 && this.alpha < 1) {
this.alpha += 0.05
}
ctx.globalAlpha = this.alpha;
ctx.drawImage(canvas2, x - this.radius / 2, y - this.radius / 2, this.radius, this.radius);
this.timePassed += this.speed
this.speed = random(this.orbitRadius) / vitesse;
};
1st error is located here (the terminal sent this to me) :
var vitesse = speedR;
// Speed function
Star.prototype.draw = function () {
2nd error is located here (the terminal sent this to me) :
this.alpha -= 0.05
} else if (twinkle === 2 && this.alpha < 1) {
this.alpha += 0.05
BUGGED SCRIPT PART 2
// Space transition function
function transitionA() {
vitesse = speedF;
setTimeout(function(){ vitesse = speedR; }, 500);
}
The 3rd error is located inside this function.
BUGGED SCRIPT PART 3
// Speed changer - Click
var spaceS = document.getElementsByClassName("spaceS");
var spaceR = document.getElementsByClassName("spaceR");
var spaceF = document.getElementsByClassName("spaceF");
// Transition - Click
var clickA = document.getElementsByClassName("clickA");
// Transition - Slide
var slideA = document.getElementsByClassName("slideA");
The error is located here (the terminal sent this to me) :
var clickA = document.getElementsByClassName("clickA");
// Transition - Slide
var slideA = document.getElementsByClassName("slideA");
Many thanks to those who will try to help me.