Skip to content

Instantly share code, notes, and snippets.

@KramKroc
Created May 28, 2020 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KramKroc/0601c5ec04485b786997ca16351c8737 to your computer and use it in GitHub Desktop.
Save KramKroc/0601c5ec04485b786997ca16351c8737 to your computer and use it in GitHub Desktop.
Restore the aliens appearance after they've been clicked
import random
WIDTH = 600
HEIGHT = 400
alien = Actor('alien', midbottom=(100,200))
def draw():
screen.fill((240, 6, 253))
alien.draw()
def update():
alien.left += 5
if alien.left > WIDTH:
alien.topright = 0, random.randint(25, 375)
def on_mouse_down(pos):
if alien.collidepoint(pos):
print("you hit me!")
sounds.eep.play()
alien.image = "alien_hurt"
clock.schedule_unique(set_alien_normal, 1.0)
else:
print("you missed me!")
def set_alien_normal():
alien.image = "alien"
@BATLER-group
Copy link

а как выпустить релиз моей игры?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment