Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##my_drawing.py by Rich While-Cooper
- ##Check out my YOUTUBE channel (same as my name) for my PYTHON tutorials playlist
- from shapes import Triangle, Rectangle, Oval, Paper
- rect1 = Rectangle()
- rect1.set_width(200)
- rect1.set_height(100)
- rect1.set_color("blue")
- rect1.draw()
- ###I found you can define all the settings for a shape
- ###on one line rather than do it attribute by attribute
- rect2 = Rectangle(100,100,50,150,color="yellow")
- ##rect2.set_x(100)
- ##rect2.set_y(100)
- ##rect2.set_width(50)
- ##rect2.set_height(150)
- #rect2.set_color("yellow")
- rect2.draw()
- oval1 = Oval(200,200,0,0,color = "red")
- ##oval1.set_x(200)
- ##oval1.set_y(200)
- ##oval1.randomize(smallest=50,largest=300)
- ##oval1.set_color("red")
- oval1.draw()
- tri1 = Triangle(5, 5, 100, 5, 100, 200,color = "purple")
- #tri1.set_color = "purple"
- tri1.draw()
- Paper.display()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement