void function ( ) { erase ( ) ; yPosition += yMove ; xPosition += xMove ; if ( xPosition >= ( 550 - diameter ) || xPosition <= 10 ) { xMove = - xMove ; } if ( yPosition >= ( 450 - diameter ) || yPosition <= 10 ) { yMove = - yMove ; } draw ( ) ; }
move this ball according to its position and speed and redraw . concode_field_sep int xPosition concode_elem_sep Canvas canvas concode_elem_sep int ySpeed concode_elem_sep Color color concode_elem_sep int diameter concode_elem_sep int xMove concode_elem_sep int yPosition concode_elem_sep int yMove concode_elem_sep int groundPosition concode_elem_sep Ellipse2D.Double circle concode_field_sep void erase concode_elem_sep int getXPosition concode_elem_sep void draw concode_elem_sep int getYPosition