22 lines
448 B
Python
22 lines
448 B
Python
import gamestates.none
|
|
import gamestates.title
|
|
import gamestates.overworld
|
|
|
|
gamestates = {
|
|
"none": gamestates.none,
|
|
"title": gamestates.title,
|
|
"overworld": gamestates.overworld
|
|
}
|
|
gamestate = "none"
|
|
|
|
def switch_gamestate(game, state):
|
|
global gamestate
|
|
gamestate = state
|
|
gamestates[gamestate].switch(game)
|
|
|
|
def update(game, dt):
|
|
gamestates[gamestate].update(game, dt)
|
|
|
|
def draw(game):
|
|
gamestates[gamestate].draw(game)
|