Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from graphics import *
- class Creature:
- def __init__(self, win, name):
- self.win = win
- self.head = Circle(Point(250, 90), 10)
- self.head.setFill(color_rgb(200, 200, 200))
- self.head.setOutline(color_rgb(100, 100, 100))
- self.body = Circle(Point(250, 120), 20)
- self.body.setFill(color_rgb(200, 200, 200))
- self.body.setOutline(color_rgb(100, 100, 100))
- self.name = Text(Point(250, 150), name)
- self.head.draw(self.win)
- self.body.draw(self.win)
- self.name.draw(self.win)
- def grow(self):
- newSize = self.body.getRadius() + 5
- self.body = Circle(Point(250, 120), newSize)
- self.body.draw(self.win)
Add Comment
Please, Sign In to add comment