ADD global context for each game state

This commit is contained in:
2025-04-19 19:51:05 +02:00
parent f96b0d579f
commit 4148e59db1
4 changed files with 38 additions and 17 deletions

View File

@@ -1,7 +1,16 @@
import pygame
class GameState:
def __init__(self, switch_state_callback, screen):
def __init__(self, switch_state_callback, context: dict):
self.switch_state = switch_state_callback
self.screen = screen
self.context = context
self.screen = self.context.get("screen")
self.match = self.context.get("match", None)
self.font = self.context.get("font", pygame.font.Font(None, 36))
self.small_font = self.context.get("small_font", pygame.font.Font(None, 15))
self.options = self.context.get("options", {
"show_yaw": True
})
def handle_events(self, events):
pass