|
@@ -4,7 +4,7 @@ from variables import *
|
|
|
|
|
|
|
|
class Tile:
|
|
class Tile:
|
|
|
def __init__(self, x: int, y: int, width: int, height: int, tiletype: str, display: pygame.display):
|
|
def __init__(self, x: int, y: int, width: int, height: int, tiletype: str, display: pygame.display):
|
|
|
- """A class for hexagonal tiles"""
|
|
|
|
|
|
|
+ """Crée une tuile hexagonale, x et y sont les coordonnées du centre de la tuile."""
|
|
|
self.x: int = x
|
|
self.x: int = x
|
|
|
self.y: int = y
|
|
self.y: int = y
|
|
|
self.width = width
|
|
self.width = width
|
|
@@ -13,8 +13,8 @@ class Tile:
|
|
|
self.display: pygame.display = display
|
|
self.display: pygame.display = display
|
|
|
|
|
|
|
|
def draw(self):
|
|
def draw(self):
|
|
|
- """Draw the tile"""
|
|
|
|
|
|
|
+ """Affiche la tuile"""
|
|
|
image = pygame.transform.scale(HEXA, (self.width, self.height))
|
|
image = pygame.transform.scale(HEXA, (self.width, self.height))
|
|
|
- self.display.blit(image, (self.x, self.y))
|
|
|
|
|
|
|
+ self.display.blit(image, (self.x - self.width // 2, self.y - self.height // 2))
|
|
|
|
|
|
|
|
|
|
|