See #2. Implemented ball edge collision.