OtsoSilver

Untitled

Aug 29th, 2021
1,114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.04 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. bonus1 = Actor('bonus', (450, 100))
  12. bonus2 = Actor('bonus', (450, 200))
  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.     bonus1.draw()
  22.     screen.draw.text("+1$ каждые 2с", center=(450, 80), color="black", fontsize = 20)
  23.     screen.draw.text("цена: 15$", center=(450, 110), color="black", fontsize = 20)
  24.     bonus2.draw()
  25.     screen.draw.text("+15$ каждые 2с", center=(450, 180), color="black", fontsize = 20)
  26.     screen.draw.text("цена: 200$", center=(450, 210), color="black", fontsize = 20)
  27.  
  28.    
  29. def on_mouse_down(button,pos):
  30.     global count
  31.     if button == mouse.LEFT:
  32.         if animal.collidepoint(pos):
  33.             count += click
  34.             animal.y = 200
  35.             animate(animal, tween='bounce_end', duration=0.5, y=250)
  36.  
Advertisement
Add Comment
Please, Sign In to add comment