OtsoSilver

Untitled

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