mirror of
https://github.com/kristoferssolo/Tetris.git
synced 2025-10-21 20:00:35 +00:00
feat(game): add Score surface
This commit is contained in:
parent
306e59ce07
commit
9c306df840
@ -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)
|
||||
Loading…
Reference in New Issue
Block a user