示例#1
0
fps = 60.0
ifps = 1.0 / fps


# Initializing objects

import Ground   #"singleton" (not a class, only globals and functions).

# Creating the map

if len(sys.argv) == 2:
    Ground.load_map(sys.argv[1])
elif len(sys.argv) == 5:
    Ground.new_map(
        sys.argv[1],
        int(sys.argv[2]), int(sys.argv[3]), int(sys.argv[4])
        )
else:
    print("""
Usage:
- python main.py [path to existing map]
- python main.py [new map name] [levels] [rows] [columns]
        """)
    sys.exit()

Ground.tile_size = 152.0
Ground.tile_separation = 150.0
Ground.zoom = 0.1


import Camera   #"singleton"