gamestatek

This commit is contained in:
markojozsef
2026-09-09 12:53:15 +02:00
commit e2890340d2
12 changed files with 112 additions and 0 deletions

19
src/gamestate.py Normal file
View File

@@ -0,0 +1,19 @@
import gamestates.none
import gamestates.title
gamestates = {
"none": gamestates.none,
"title": gamestates.title
}
gamestate = "none"
def switch_gamestate(state):
global gamestate
gamestate = state
gamestates[gamestate].switch()
def update(dt):
gamestates[gamestate].update(dt)
def draw(screen):
gamestates[gamestate].draw(screen)