diff --git a/src/game/block.py b/src/game/block.py index ee1ee4a..c48f84a 100644 --- a/src/game/block.py +++ b/src/game/block.py @@ -10,7 +10,7 @@ class Block(pygame.sprite.Sprite): self.image = pygame.Surface(CONFIG.game.cell) self.image.fill(color) - self.pos = pygame.Vector2(pos) + self.pos = pygame.Vector2(pos) + CONFIG.game.offset x = self.pos.x * CONFIG.game.cell.width y = self.pos.y * CONFIG.game.cell.height self.rect = self.image.get_rect(topleft=(x, y)) diff --git a/src/utils/config.py b/src/utils/config.py index aa063f8..b2eea93 100644 --- a/src/utils/config.py +++ b/src/utils/config.py @@ -17,6 +17,7 @@ class Game: cell: Size = Size(40, 40) size: Size = Size(columns * cell.width, rows * cell.width) pos: Vec2 = Vec2(padding, padding) + offset: Vec2 = Vec2(columns // 2, -1) @define