Prev Up
Go backward to The Right Wall
Go up to Bouncing

The Other Walls

At this point, depending on the speeds you picked for your ball initially, it is either falling off the bottom or going through the left wall. What you should do now is add an if statement to make the ball bounce off whatever wall it currently disappears through. Then, run your applet again, see where it disappears next and fix then add an if statement for that wall. In that way, you will add one if statement at a time until you have one for each wall. They will all be similar, but:

When all the if statements are in place, the ball should bounce from wall to wall until you select quit from the file menu.


Prev Up