Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pgzero
- WIDTH = 600
- HEIGHT = 400
- TITLE = "Animal clicker"
- FPS = 30
- # Объекты
- animal = Actor("giraffe", (150, 250))
- fon = Actor("fon")
- bonus_1 = Actor("bonus", (450, 100))
- bonus_2 = Actor("bonus", (450, 200))
- # Переменные
- count = 0
- click = 1
- price_bonus_1 = 15
- price_bonus_2 = 200
- def draw():
- fon.draw()
- animal.draw()
- screen.draw.text(count,color='white', center = (150,100), fontsize=96)
- bonus_1.draw()
- screen.draw.text("+1$ каждые 2с", center=(450, 80), color="black", fontsize = 20)
- screen.draw.text("цена: "+str(price_bonus_1)+"$", center=(450, 110), color="black",
- fontsize = 20)
- bonus_2.draw()
- screen.draw.text("+15$ каждые 2с", center=(450, 180), color="black", fontsize = 20)
- screen.draw.text("цена: "+str(price_bonus_2)+"$", center=(450, 210), color="black",
- fontsize = 20)
- def on_mouse_down(button, pos):
- global count
- if button == mouse.LEFT:
- if animal.collidepoint(pos):
- count+=click
- animal.y = 200
- animate(animal, tween='bounce_end', duration=0.5, y=250)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement