Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pgzero
- WIDTH = 600
- HEIGHT = 400
- WHITE = (255,255,255)
- 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, color = WHITE, center = (150,100), fontsize = 96)
- def on_mouse_down(button,pos):
- global count
- if button == mouse.LEFT and 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