The first thing we are going to do is clean up the code and change the double slashes (//) to pound signs (#) Now we are going to change void setup(){} and void draw(){} to def setup (): and def draw (): and delete all the semi colons and curly brackets. Next we are going to add colons after all the if statements. Next we are going to delete the word float every time it appears. Next we are going to delete the else form the last if statement. Now we are going to change void mousePressed(): to if (mousePressed): Now we are going to change the double lines in this statement; if ((x > width - w) || (x <= 0)): to the word "or" Now we are going to add
global x
global y
global w
global h
global speedY
global speedX
under def draw ():
Your code should look like this:
Your code should should successful print a program that shows a bouncing ball.
can you give a copy and paste code
ReplyDelete