Opened: Saturday, 20 May 2017, 9:55 AM
We have learned how to create code to draw a rectangle, move it and keep it inside the window.
- Starting from the code below, for the bouncing rectangle, comment or replace the command that creates the rectangle and create a red circle of 20 pixel radius. The command is already written but commented inside the code in line 65.
- Then try to move it changing the static center [200, 140] with the variables rect_x and rect_y.
- Correct the values in if commands so the circle stays completely inside the window and bounces at the edges.
- 18 May 2017, 6:55 PM