Guest User

Untitled

a guest
Jun 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. from graphics import *
  2.  
  3. class Creature:
  4. def __init__(self, win, name):
  5. self.win = win
  6. self.head = Circle(Point(250, 90), 10)
  7. self.head.setFill(color_rgb(200, 200, 200))
  8. self.head.setOutline(color_rgb(100, 100, 100))
  9. self.body = Circle(Point(250, 120), 20)
  10. self.body.setFill(color_rgb(200, 200, 200))
  11. self.body.setOutline(color_rgb(100, 100, 100))
  12. self.name = Text(Point(250, 150), name)
  13. self.head.draw(self.win)
  14. self.body.draw(self.win)
  15. self.name.draw(self.win)
  16.  
  17. def grow(self):
  18. newSize = self.body.getRadius() + 5
  19. self.body = Circle(Point(250, 120), newSize)
  20. self.body.draw(self.win)
Add Comment
Please, Sign In to add comment