tiles.py 582 B

1234567891011121314151617181920
  1. import pygame, os
  2. from variables import *
  3. class Tile:
  4. def __init__(self, x: int, y: int, width: int, height: int, tiletype: str, display: pygame.display):
  5. """A class for hexagonal tiles"""
  6. self.x: int = x
  7. self.y: int = y
  8. self.width = width
  9. self.height = height
  10. self.tiletype: str = tiletype
  11. self.display: pygame.display = display
  12. def draw(self):
  13. """Draw the tile"""
  14. image = pygame.transform.scale(HEXA, (self.width, self.height))
  15. self.display.blit(image, (self.x, self.y))