Problem with a variable that doesn't work well between class definition and global variables

i have a problem with the variable that i defined named ‘ballSpeed’ that i expected that it should become a greater number when mouse is pressed but it’s speed won’t change. on the other hand, other variables such as color and ballSize is working good.
If anyone can help, I would be very grateful.

You got 2 ballspeeds, one global and one in the class

Get rid of the global one and change the one in the cöass in mousePressed

1 Like