I am programming a graphical text adventure using python. The game is playable, but I am not sure whether the code is well-suited for newcomers (code smells / quirks / general readability).
Here's the main script:
import time
import sys
import printer
from rooms import *
from _player import Player
VER = 0.01
SCENES = {0 : Lobby(),
1 : LivingRoom(),
2 : Bathroom()}
player = Player()
def run(start_at=None):
"""Starts the game"""
if not start_at:
scene = SCENES[0]
else:
scene = SCENES[start_at]
scene.init_player(player)
while 1:
new_scene = scene.run()
if new_scene != None:
scene = SCENES[new_scene]
scene.init_player(player)
if __name__ == "__main__":
run()