I am using the below code to simulate "Purple Rain" (from The Coding Train on YouTube).
Class Drop(){
float x = width/2;
float y = 0;
float yspeed = 1;
void fall(){
y = y + yspeed;
}
void show(){
stroke(138, 43, 226); //purple rain
line(x, y, x, y+10);
}
}
However, I am getting the error unexpected token: void
on line 6:
void fall(){
I can't see any syntax errors - could someone suggest why I am getting this error?