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")
- # Переменные
- count = 0
- click = 1
- def draw():
- fon.draw()
- animal.draw()
- screen.draw.text(count, center=(150, 100), color="white", fontsize = 96)
- def on_mouse_down(button, pos):
- global count
- if button == mouse.LEFT:
- # Клик по объекту animal
- 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