-
-
Save parzibyte/ac18d68188303a809539bf768b46cee4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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