Rectangle Class
Create the Rectangle class which is derived from Shape with the following properties:
- Create two integer instance variables for a width and height
- Create a constructor which takes five arguments:
- x coordinate
- y coordinate
- width
- height
- canvas (PApplet)
- Invoke the super constructor with x and y coordinates and the canvas as parameters.
-
Create a draw method which overrides Shape's draw method.
You should call the rect() method defined in PApplet.
Use Shape's canvas accessor to get a handle on Shape's PApplet.
The rect() methods takes four arguments (x , y , width , height)
See the Processing API for more details on the Processing API.