I'm a beginner/intermediate programmer, using .pde for my undergraduate course. Am hoping the relevant useful guidance will come my way on here. Today I tried running the following simple sketch:
float x
=32;
float y
=128;
float dx
;
float dy
;
float gravity
=5;
float ballSize
=20;
void setup
(){
size
(512,
512, P3D
);
fill
(255);
noStroke
();
frameRate
(20);
background
(0);
dx
=5;
dy
=10;
}
void draw
(){
background
(0);
translate
(x,y
);
ellipse
(0,
0,ballSize,ballSize
);
if(x
> width
/2|| x
< width
/2);
dx
=-dx
;
if(y
> height
- ballsize
/2);
dy
=-dy
;
else
dy
+= gravity
;
x
+= dx
;
y
+= dy
;
}
Instead of running, it's throwing 'Found one too many { characters without a } to match it.' when in reality there seems to be no real problems with any of the syntax at all.
Earlier today I tried running the same sketch, and got another error saying 'Processing cannot run because the GLSL shaders are not available', for which I found this thread:
https://forum.processing.org/topic/glsl-shader-help as previous troubleshooting by others, but all that is irrelevant for my simple sketch
So I uninstalled and reinstalled processing, but this hasn't helped much at all. My best guess us it's something related to the libraries and how they're getting mapped when installed, but I'm not sure what I'm doing wrong at all.