gamestatek
This commit is contained in:
19
src/gamestate.py
Normal file
19
src/gamestate.py
Normal 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)
|
||||
Reference in New Issue
Block a user