OtsoSilver

Untitled

Aug 29th, 2021
1,195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. #pgzero
  2.  
  3. WIDTH = 600
  4. HEIGHT = 400
  5. WHITE = (255,255,255)
  6. TITLE = "Animal clicker"
  7. FPS = 30
  8.  
  9. # Объекты
  10. animal = Actor("giraffe", (150, 250))
  11. fon = Actor("fon")
  12.  
  13. # Переменные
  14. count = 0
  15. click = 1
  16.  
  17. def draw():
  18.     fon.draw()
  19.     animal.draw()
  20.     screen.draw.text(count, color = WHITE, center = (150,100), fontsize = 96)
  21.    
  22. def on_mouse_down(button,pos):
  23.     global count
  24.     if button == mouse.LEFT and animal.collidepoint(pos):
  25.         count += click
  26.         animal.y = 200
  27.         animate(animal, tween='bounce_end', duration=0.5, y=250)
  28.  
  29.  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment