implemented the basic physics of ball movement