Advertisement
OtsoSilver

Untitled

Sep 4th, 2021
1,322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.27 KB | None | 0 0
  1. #pgzero
  2.  
  3. WIDTH = 600
  4. HEIGHT = 400
  5.  
  6. TITLE = "Animal clicker"
  7. FPS = 30
  8.  
  9. # Объекты
  10. animal = Actor("giraffe", (150, 250))
  11. fon = Actor("fon")
  12. bonus_1 = Actor("bonus", (450, 100))
  13. bonus_2 = Actor("bonus", (450, 200))
  14. # Переменные
  15. count = 0
  16. click = 1
  17. price_bonus_1 = 15
  18. price_bonus_2 = 200
  19. def draw():
  20.     fon.draw()
  21.     animal.draw()
  22.     screen.draw.text(count,color='white', center = (150,100), fontsize=96)
  23.     bonus_1.draw()
  24.     screen.draw.text("+1$ каждые 2с", center=(450, 80), color="black", fontsize = 20)
  25.     screen.draw.text("цена: "+str(price_bonus_1)+"$", center=(450, 110), color="black",
  26.                                                                             fontsize = 20)
  27.     bonus_2.draw()
  28.     screen.draw.text("+15$ каждые 2с", center=(450, 180), color="black", fontsize = 20)
  29.     screen.draw.text("цена: "+str(price_bonus_2)+"$", center=(450, 210), color="black",
  30.                                                                             fontsize = 20)
  31.  
  32.    
  33.  
  34. def on_mouse_down(button, pos):
  35.     global count
  36.     if button == mouse.LEFT:
  37.         if animal.collidepoint(pos):
  38.             count+=click
  39.             animal.y = 200
  40.             animate(animal, tween='bounce_end', duration=0.5, y=250)
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement