Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 6, 2020 00:28
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 parzibyte/ac18d68188303a809539bf768b46cee4 to your computer and use it in GitHub Desktop.
Save parzibyte/ac18d68188303a809539bf768b46cee4 to your computer and use it in GitHub Desktop.
# Si hicieron clic y el usuario puede jugar...
elif event.type == pygame.MOUSEBUTTONDOWN and puede_jugar:
"""
xAbsoluto e yAbsoluto son las coordenadas de la pantalla en donde se hizo
clic. PyGame no ofrece detección de clic en imagen, por ejemplo. Así que
se deben hacer ciertos trucos
"""
# Si el click fue sobre el botón y el juego no se ha iniciado, entonces iniciamos el juego
xAbsoluto, yAbsoluto = event.pos
if boton.collidepoint(event.pos):
if not juego_iniciado:
iniciar_juego()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment