Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created November 5, 2020 22:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/862fedbb3ade93eb77a1ab953065aec7 to your computer and use it in GitHub Desktop.
Save parzibyte/862fedbb3ade93eb77a1ab953065aec7 to your computer and use it in GitHub Desktop.
"""
Una clase que representa el cuadro. El mismo tiene una imagen y puede estar
descubierto (cuando ya lo han descubierto anteriormente y no es la tarjeta buscada actualmente)
o puede estar mostrado (cuando se voltea la imagen)
También tiene una fuente o nombre de imagen que servirá para compararlo más tarde
"""
class Cuadro:
def __init__(self, fuente_imagen):
self.mostrar = True
self.descubierto = False
"""
Una cosa es la fuente de la imagen (es decir, el nombre del archivo) y otra
la imagen lista para ser pintada por PyGame
La fuente la necesitamos para más tarde, comparar las tarjetas
"""
self.fuente_imagen = fuente_imagen
self.imagen_real = pygame.image.load(fuente_imagen)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment