mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2026-03-22 00:36:20 +00:00
feat(game): add Score surface
This commit is contained in:
@@ -8,6 +8,4 @@ class Game:
|
||||
self.dispaly_surface = pygame.display.get_surface()
|
||||
|
||||
def run(self) -> None:
|
||||
self.dispaly_surface.blit(
|
||||
self.surface, (CONFIG.window.padding, CONFIG.window.padding)
|
||||
)
|
||||
self.dispaly_surface.blit(self.surface, CONFIG.game.pos)
|
||||
|
||||
14
src/game/score.py
Normal file
14
src/game/score.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import pygame
|
||||
from utils import CONFIG, Size
|
||||
|
||||
|
||||
class Score:
|
||||
def __init__(self) -> None:
|
||||
self.surface = pygame.Surface(CONFIG.sidebar.score)
|
||||
self.rect = self.surface.get_rect(
|
||||
bottomright=CONFIG.window.size.sub(CONFIG.window.padding)
|
||||
)
|
||||
self.dispaly_surface = pygame.display.get_surface()
|
||||
|
||||
def run(self) -> None:
|
||||
self.dispaly_surface.blit(self.surface, self.rect)
|
||||
Reference in New Issue
Block a user